From 97ad0753e09dbdd75ec1ed6377f83f7c25d8b6a5 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 2 Nov 2020 22:20:41 +0300 Subject: [PATCH] restore direct fetching of styles in the options frame regressed in bf40fa81 --- js/msg.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/msg.js b/js/msg.js index 57ca488b..b2c9203f 100644 --- a/js/msg.js +++ b/js/msg.js @@ -143,14 +143,14 @@ window.INJECTED !== 1 && (() => { bg = await browser.runtime.getBackgroundPage().catch(() => {}); } const message = {method: 'invokeAPI', name, args}; - // content scripts, frames and probably private tabs - if (!bg || window !== parent) { + // content scripts and probably private tabs + if (!bg) { return msg.send(message); } // in FF, the object would become a dead object when the window // is closed, so we have to clone the object into background. const res = bg.msg._execute(TARGETS.extension, bg.deepCopy(message), { - frameId: 0, + frameId: 0, // false in case of our Options frame but we really want to fetch styles early tab: NEEDS_TAB_IN_SENDER.includes(name) && await getOwnTab(), url: location.href, });