mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02: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) => {
|
browser.tabs.onRemoved.addListener((tabId, details) => {
|
||||||
if ( vAPI.net ) {
|
if ( vAPI.net && vAPI.net.hasUnprocessedRequest(tabId) ) {
|
||||||
vAPI.net.removeUnprocessedRequest(tabId);
|
vAPI.net.removeUnprocessedRequest(tabId);
|
||||||
}
|
}
|
||||||
this.onRemovedHandler(tabId, details);
|
this.onRemovedHandler(tabId, details);
|
||||||
@ -1375,9 +1375,9 @@ vAPI.Net = class {
|
|||||||
// - Aggressively clear the unprocessed-request status of all tabs as
|
// - Aggressively clear the unprocessed-request status of all tabs as
|
||||||
// soon as there is a call to clear for one tab.
|
// soon as there is a call to clear for one tab.
|
||||||
removeUnprocessedRequest() {
|
removeUnprocessedRequest() {
|
||||||
|
if ( this.unprocessedTabs.size === 0 ) { return true; }
|
||||||
this.unprocessedTabs.clear();
|
this.unprocessedTabs.clear();
|
||||||
if ( this.deferredSuspendableListener === undefined ) { return true; }
|
if ( this.deferredSuspendableListener === undefined ) { return true; }
|
||||||
if ( this.unprocessedTabs.size !== 0 ) { return false; }
|
|
||||||
this.suspendableListener = this.deferredSuspendableListener;
|
this.suspendableListener = this.deferredSuspendableListener;
|
||||||
this.deferredSuspendableListener = undefined;
|
this.deferredSuspendableListener = undefined;
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user