mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-05 18:49:39 +02:00
Firefox: match Chrome's behavior with frame ids
This commit is contained in:
parent
a926eb7ead
commit
3150c286cf
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user