mirror of https://github.com/gorhill/uBlock.git
Code review related to the early blocking of network requests at launch
This commit is contained in:
parent
fe595bb2b9
commit
be9e7fd11c
|
@ -170,8 +170,8 @@ vAPI.net.onBeforeReady = (function() {
|
||||||
stop: function(resolver) {
|
stop: function(resolver) {
|
||||||
if ( pendings === undefined ) { return; }
|
if ( pendings === undefined ) { return; }
|
||||||
for ( const pending of pendings ) {
|
for ( const pending of pendings ) {
|
||||||
const result = resolver(pending.details);
|
vAPI.net.normalizeDetails(pending.details);
|
||||||
pending.resolve(result);
|
pending.resolve(resolver(pending.details));
|
||||||
}
|
}
|
||||||
pendings = undefined;
|
pendings = undefined;
|
||||||
},
|
},
|
||||||
|
|
|
@ -46,13 +46,11 @@
|
||||||
|
|
||||||
µBlock.FilteringContext.prototype = {
|
µBlock.FilteringContext.prototype = {
|
||||||
fromTabId: function(tabId) {
|
fromTabId: function(tabId) {
|
||||||
if ( tabId !== -1 || tabId !== this.tabId ) {
|
|
||||||
const tabContext = µBlock.tabContextManager.mustLookup(tabId);
|
const tabContext = µBlock.tabContextManager.mustLookup(tabId);
|
||||||
this.tabOrigin = tabContext.origin;
|
this.tabOrigin = tabContext.origin;
|
||||||
this.tabHostname = tabContext.rootHostname;
|
this.tabHostname = tabContext.rootHostname;
|
||||||
this.tabDomain = tabContext.rootDomain;
|
this.tabDomain = tabContext.rootDomain;
|
||||||
this.tabId = tabId;
|
this.tabId = tabContext.tabId;
|
||||||
}
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
fromWebrequestDetails: function(details) {
|
fromWebrequestDetails: function(details) {
|
||||||
|
|
Loading…
Reference in New Issue