Fix outer CSS being incorrectly injected (#1075)
This commit is contained in:
parent
008ffdb6bf
commit
a8cd03cbec
@ -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; }
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user