1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-14 23:12:28 +02:00

Fix typo which could lead to improper filtering context

Related discussion:
- 354ac4f57b (commitcomment-32715209)
This commit is contained in:
Raymond Hill 2019-03-15 07:47:36 -04:00
parent 875542c964
commit 580c3885df
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -76,18 +76,21 @@
} else if ( details.documentUrl !== undefined ) { } else if ( details.documentUrl !== undefined ) {
this.setDocOriginFromURL(details.documentUrl); this.setDocOriginFromURL(details.documentUrl);
} else { } else {
const pageStore = µBlock.pageStoreFromTabId(this.docId); const pageStore = µBlock.pageStoreFromTabId(this.tabId);
const docStore = pageStore && pageStore.frames.get(this.docId); const docStore = pageStore && pageStore.frames.get(this.docId);
if ( docStore ) { if ( docStore ) {
this.docOrigin = undefined; this.docOrigin = undefined;
this.docHostname = docStore.pageHostname; this.docHostname = docStore.pageHostname;
this.docDomain = docStore.pageDomain; this.docDomain = docStore.pageDomain;
} else {
this.setDocOrigin(this.tabOrigin);
} }
} }
} else if ( details.documentUrl !== undefined ) { } else if ( details.documentUrl !== undefined ) {
const normalURL = µBlock.normalizePageURL(0, details.documentUrl); const origin = this.originFromURI(
this.setTabOriginFromURL(normalURL); µBlock.normalizePageURL(0, details.documentUrl)
this.setDocOriginFromURL(normalURL); );
this.setDocOrigin(origin).setTabOrigin(origin);
} else if ( this.type === 'sub_frame' ) { } else if ( this.type === 'sub_frame' ) {
const origin = this.originFromURI(this.url); const origin = this.originFromURI(this.url);
this.setDocOrigin(origin).setTabOrigin(origin); this.setDocOrigin(origin).setTabOrigin(origin);