diff options
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/bg/js/settings/popup-preview-frame.js | 4 | ||||
| -rw-r--r-- | ext/fg/js/popup.js | 5 | 
2 files changed, 5 insertions, 4 deletions
| diff --git a/ext/bg/js/settings/popup-preview-frame.js b/ext/bg/js/settings/popup-preview-frame.js index c2c91202..8225ecb8 100644 --- a/ext/bg/js/settings/popup-preview-frame.js +++ b/ext/bg/js/settings/popup-preview-frame.js @@ -105,8 +105,8 @@ class PopupPreviewFrame {          return options;      } -    _onCustomOuterCssChanged({node}) { -        if (node === null) { return; } +    _onCustomOuterCssChanged({node, inShadow}) { +        if (node === null || inShadow) { return; }          const node2 = document.querySelector('#popup-outer-css');          if (node2 === null) { return; } 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() { |