mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +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:
parent
1c63aa719d
commit
7735b35e21
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue