mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 09:31:01 +01:00
try as much as possible to bind root doc to tab (#1001)
This commit is contained in:
parent
6dd4a244fc
commit
0f206fd602
1 changed files with 8 additions and 2 deletions
|
@ -201,12 +201,19 @@ var onHeadersReceived = function(details) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var requestURL = details.url;
|
||||||
|
|
||||||
// Lookup the page store associated with this tab id.
|
// Lookup the page store associated with this tab id.
|
||||||
var µb = µBlock;
|
var µb = µBlock;
|
||||||
var pageStore = µb.pageStoreFromTabId(tabId);
|
var pageStore = µb.pageStoreFromTabId(tabId);
|
||||||
|
if ( !pageStore ) {
|
||||||
|
if ( details.type === 'main_frame' && details.parentFrameId === -1 ) {
|
||||||
|
pageStore = µb.bindTabToPageStats(tabId, requestURL, 'beforeRequest');
|
||||||
|
}
|
||||||
if ( !pageStore ) {
|
if ( !pageStore ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/384
|
// https://github.com/gorhill/uBlock/issues/384
|
||||||
// https://github.com/gorhill/uBlock/issues/540
|
// https://github.com/gorhill/uBlock/issues/540
|
||||||
|
@ -215,7 +222,6 @@ var onHeadersReceived = function(details) {
|
||||||
// pageStore.skipLocalMirroring = headerStartsWith(details.responseHeaders, 'content-security-policy') !== '';
|
// pageStore.skipLocalMirroring = headerStartsWith(details.responseHeaders, 'content-security-policy') !== '';
|
||||||
//}
|
//}
|
||||||
|
|
||||||
var requestURL = details.url;
|
|
||||||
var requestHostname = details.hostname;
|
var requestHostname = details.hostname;
|
||||||
|
|
||||||
// https://github.com/gorhill/uBlock/issues/525
|
// https://github.com/gorhill/uBlock/issues/525
|
||||||
|
|
Loading…
Reference in a new issue