From df2ffce8aaf48153c7d8f28bbd57d40ea3334dc4 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Sun, 15 Feb 2015 19:25:11 +0100 Subject: [PATCH] Firefox: match Chrome's behavior with frame ids --- platform/firefox/frameModule.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index e0915eb..3a16c70 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -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;