From 500213f47901eb659e2202e45d945de1be0c0908 Mon Sep 17 00:00:00 2001 From: Deathamns Date: Tue, 16 Dec 2014 16:35:14 +0100 Subject: [PATCH] Firefox: observe main_frame requests too --- platform/firefox/frameModule.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index aed70d8..126a4d9 100644 --- a/platform/firefox/frameModule.js +++ b/platform/firefox/frameModule.js @@ -84,11 +84,13 @@ let contentPolicy = { ); }, shouldLoad: function(type, location, origin, context) { - if (type === 6 || !context || !/^https?$/.test(location.scheme)) { + if (!context || !/^https?$/.test(location.scheme)) { return this.ACCEPT; } - let win = (context.ownerDocument || context).defaultView; + let win = type === 6 + ? context.contentWindow + : (context.ownerDocument || context).defaultView; if (!win) { return this.ACCEPT; @@ -98,7 +100,7 @@ let contentPolicy = { url: location.spec, type: type, tabId: -1, - frameId: win === win.top ? 0 : 1, + frameId: type === 6 ? -1 : (win === win.top ? 0 : 1), parentFrameId: win === win.top ? -1 : 0 })[0];