mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-22 18:32:45 +01:00
Time when main listener was installed is enough
This commit is contained in:
parent
86477dd4e5
commit
0575567d2a
@ -1252,7 +1252,7 @@ vAPI.Net = class {
|
|||||||
this.listenerMap = new WeakMap();
|
this.listenerMap = new WeakMap();
|
||||||
this.suspendDepth = 0;
|
this.suspendDepth = 0;
|
||||||
this.unprocessedTabs = new Map();
|
this.unprocessedTabs = new Map();
|
||||||
this.lastUnprocessedRequestTime = Number.MAX_SAFE_INTEGER;
|
this.processRequestStartTime = Number.MAX_SAFE_INTEGER;
|
||||||
|
|
||||||
browser.webRequest.onBeforeRequest.addListener(
|
browser.webRequest.onBeforeRequest.addListener(
|
||||||
details => {
|
details => {
|
||||||
@ -1335,6 +1335,7 @@ vAPI.Net = class {
|
|||||||
}
|
}
|
||||||
return this.deferredSuspendableListener(details);
|
return this.deferredSuspendableListener(details);
|
||||||
};
|
};
|
||||||
|
this.processRequestStartTime = Date.now();
|
||||||
}
|
}
|
||||||
this.suspendableListener = listener;
|
this.suspendableListener = listener;
|
||||||
vAPI.setDefaultIcon('', '');
|
vAPI.setDefaultIcon('', '');
|
||||||
@ -1367,11 +1368,10 @@ vAPI.Net = class {
|
|||||||
this.unprocessedTabs.set(tabId, (requests = []));
|
this.unprocessedTabs.set(tabId, (requests = []));
|
||||||
}
|
}
|
||||||
requests.push(Object.assign({}, details));
|
requests.push(Object.assign({}, details));
|
||||||
this.lastUnprocessedRequestTime = Date.now();
|
|
||||||
}
|
}
|
||||||
hasUnprocessedRequest(tabId) {
|
hasUnprocessedRequest(tabId) {
|
||||||
if ( this.unprocessedTabs.size === 0 ) { return false; }
|
if ( this.unprocessedTabs.size === 0 ) { return false; }
|
||||||
if ( (Date.now() - this.lastUnprocessedRequestTime) > 60000 ) {
|
if ( (Date.now() - this.processRequestStartTime) > 60000 ) {
|
||||||
this.removeUnprocessedRequest();
|
this.removeUnprocessedRequest();
|
||||||
}
|
}
|
||||||
return this.unprocessedTabs.has(tabId);
|
return this.unprocessedTabs.has(tabId);
|
||||||
|
Loading…
Reference in New Issue
Block a user