From a8cd03cbecf4015483ce3479e589e65ce7eece45 Mon Sep 17 00:00:00 2001
From: toasted-nutbread <toasted-nutbread@users.noreply.github.com>
Date: Sun, 29 Nov 2020 12:00:41 -0500
Subject: Fix outer CSS being incorrectly injected (#1075)

---
 ext/fg/js/popup.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'ext/fg/js')

diff --git a/ext/fg/js/popup.js b/ext/fg/js/popup.js
index 0328edda..ffd72dca 100644
--- a/ext/fg/js/popup.js
+++ b/ext/fg/js/popup.js
@@ -195,12 +195,13 @@ class Popup extends EventDispatcher {
 
     async setCustomOuterCss(css, useWebExtensionApi) {
         let parentNode = null;
-        if (this._shadow !== null) {
+        const inShadow = (this._shadow !== null);
+        if (inShadow) {
             useWebExtensionApi = false;
             parentNode = this._shadow;
         }
         const node = await dynamicLoader.loadStyle('yomichan-popup-outer-user-stylesheet', 'code', css, useWebExtensionApi, parentNode);
-        this.trigger('customOuterCssChanged', {node, useWebExtensionApi});
+        this.trigger('customOuterCssChanged', {node, useWebExtensionApi, inShadow});
     }
 
     getFrameRect() {
-- 
cgit v1.2.3