Fix outer CSS being incorrectly injected (#1075)
This commit is contained in:
parent
008ffdb6bf
commit
a8cd03cbec
@ -105,8 +105,8 @@ class PopupPreviewFrame {
|
|||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onCustomOuterCssChanged({node}) {
|
_onCustomOuterCssChanged({node, inShadow}) {
|
||||||
if (node === null) { return; }
|
if (node === null || inShadow) { return; }
|
||||||
|
|
||||||
const node2 = document.querySelector('#popup-outer-css');
|
const node2 = document.querySelector('#popup-outer-css');
|
||||||
if (node2 === null) { return; }
|
if (node2 === null) { return; }
|
||||||
|
@ -195,12 +195,13 @@ class Popup extends EventDispatcher {
|
|||||||
|
|
||||||
async setCustomOuterCss(css, useWebExtensionApi) {
|
async setCustomOuterCss(css, useWebExtensionApi) {
|
||||||
let parentNode = null;
|
let parentNode = null;
|
||||||
if (this._shadow !== null) {
|
const inShadow = (this._shadow !== null);
|
||||||
|
if (inShadow) {
|
||||||
useWebExtensionApi = false;
|
useWebExtensionApi = false;
|
||||||
parentNode = this._shadow;
|
parentNode = this._shadow;
|
||||||
}
|
}
|
||||||
const node = await dynamicLoader.loadStyle('yomichan-popup-outer-user-stylesheet', 'code', css, useWebExtensionApi, parentNode);
|
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() {
|
getFrameRect() {
|
||||||
|
Loading…
Reference in New Issue
Block a user