1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-26 18:10:39 +12:00

Firefox: match Chrome's behavior with frame ids

This commit is contained in:
Deathamns 2015-02-15 19:25:11 +01:00 committed by gorhill
parent 1b66ce8b40
commit df2ffce8aa

View file

@ -139,6 +139,8 @@ const contentObserver = {
&& this.ignoredPopups.has(context) === false ) {
openerURL = context.opener.location.href;
}
} else if ( type === 7 ) { // SUB_DOCUMENT
context = context.contentWindow;
} else {
context = (context.ownerDocument || context).defaultView;
}
@ -149,12 +151,10 @@ const contentObserver = {
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 parentFrameId;
if ( isTopLevel && type === this.MAIN_FRAME ) {
if ( isTopLevel ) {
parentFrameId = -1;
} else if ( context.parent === context.top ) {
parentFrameId = 0;