Firefox: match Chrome's behavior with frame ids

This commit is contained in:
Deathamns 2015-02-15 19:25:11 +01:00
parent a926eb7ead
commit 3150c286cf
1 changed files with 3 additions and 3 deletions

View File

@ -139,6 +139,8 @@ const contentObserver = {
&& this.ignoredPopups.has(context) === false ) { && this.ignoredPopups.has(context) === false ) {
openerURL = context.opener.location.href; openerURL = context.opener.location.href;
} }
} else if ( type === 7 ) { // SUB_DOCUMENT
context = context.contentWindow;
} else { } else {
context = (context.ownerDocument || context).defaultView; context = (context.ownerDocument || context).defaultView;
} }
@ -149,12 +151,10 @@ const contentObserver = {
return this.ACCEPT; return this.ACCEPT;
} }
// https://github.com/gorhill/uBlock/issues/795
// Only the top main frame can be an orphan
let isTopLevel = context === context.top; let isTopLevel = context === context.top;
let parentFrameId; let parentFrameId;
if ( isTopLevel && type === this.MAIN_FRAME ) { if ( isTopLevel ) {
parentFrameId = -1; parentFrameId = -1;
} else if ( context.parent === context.top ) { } else if ( context.parent === context.top ) {
parentFrameId = 0; parentFrameId = 0;