mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-22 18:32:45 +01:00
Minor code review
This commit is contained in:
parent
df318a4fe6
commit
a1619a118d
@ -288,7 +288,7 @@ vAPI.Tabs = class {
|
||||
});
|
||||
}
|
||||
browser.tabs.onRemoved.addListener((tabId, details) => {
|
||||
if ( vAPI.net ) {
|
||||
if ( vAPI.net && vAPI.net.hasUnprocessedRequest(tabId) ) {
|
||||
vAPI.net.removeUnprocessedRequest(tabId);
|
||||
}
|
||||
this.onRemovedHandler(tabId, details);
|
||||
@ -1375,9 +1375,9 @@ vAPI.Net = class {
|
||||
// - Aggressively clear the unprocessed-request status of all tabs as
|
||||
// soon as there is a call to clear for one tab.
|
||||
removeUnprocessedRequest() {
|
||||
if ( this.unprocessedTabs.size === 0 ) { return true; }
|
||||
this.unprocessedTabs.clear();
|
||||
if ( this.deferredSuspendableListener === undefined ) { return true; }
|
||||
if ( this.unprocessedTabs.size !== 0 ) { return false; }
|
||||
this.suspendableListener = this.deferredSuspendableListener;
|
||||
this.deferredSuspendableListener = undefined;
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user