Do not bypass network listener in suspended mode

Tabless network requests were bypassing uBO's
onBeforeRequest's listener when in suspended
mode. Suspend mode occurs during the time the
filter lists are all reloaded.

Regression from:
- 1dfdc40e09 (diff-d04c15ee6bff6a6269c6aee25a7c7522R1122)
This commit is contained in:
Raymond Hill 2019-10-07 08:13:37 -04:00
parent eb1ccec242
commit 35cb0eb377
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 2 additions and 3 deletions

View File

@ -1157,11 +1157,10 @@ vAPI.Net = class {
browser.webRequest.onBeforeRequest.addListener(
details => {
this.normalizeDetails(details);
if ( this.suspendDepth === 0 ) {
if ( this.suspendDepth === 0 || details.tabId < 0 ) {
if ( this.suspendableListener === undefined ) { return; }
return this.suspendableListener(details);
}
if ( details.tabId < 0 ) { return; }
return this.suspendOneRequest(details);
},
this.denormalizeFilters({ urls: [ 'http://*/*', 'https://*/*' ] }),

View File

@ -115,7 +115,7 @@
resolve: undefined,
promise: undefined
};
pending.promise = new Promise(function(resolve) {
pending.promise = new Promise(resolve => {
pending.resolve = resolve;
});
this.pendingRequests.push(pending);