1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

Fix uncaught rejected promise in assets.fetchText()

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/534

Regression from
a52b07ff6e
This commit is contained in:
Raymond Hill 2019-04-21 06:12:20 -04:00
parent 1c63aa719d
commit 7735b35e21
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -83,7 +83,7 @@ api.fetchText = function(url, onLoad, onError) {
onError = onLoad;
}
return new Promise((resolve, reject) => {
return new Promise(resolve => {
// Start of executor
const timeoutAfter = µBlock.hiddenSettings.assetFetchTimeout * 1000 || 30000;
@ -104,16 +104,16 @@ api.fetchText = function(url, onLoad, onError) {
const onResolve = function(details) {
if ( onLoad instanceof Function ) {
onLoad(details);
return onLoad(details);
}
resolve(details);
};
const onReject = function(details) {
if ( onError instanceof Function ) {
onError(details);
return onError(details);
}
reject(details);
resolve(details);
};
// https://github.com/gorhill/uMatrix/issues/15