fixup: run updateExposeIframes only in frames
This commit is contained in:
parent
7605bfe10b
commit
3fb2bc6ddc
|
@ -46,10 +46,12 @@ self.INJECTED !== 1 && (() => {
|
||||||
function onInjectorUpdate() {
|
function onInjectorUpdate() {
|
||||||
if (!isOrphaned) {
|
if (!isOrphaned) {
|
||||||
updateCount();
|
updateCount();
|
||||||
updateExposeIframes();
|
|
||||||
const onOff = prefs[styleInjector.list.length ? 'subscribe' : 'unsubscribe'];
|
const onOff = prefs[styleInjector.list.length ? 'subscribe' : 'unsubscribe'];
|
||||||
onOff(['disableAll'], updateDisableAll);
|
onOff(['disableAll'], updateDisableAll);
|
||||||
if (IS_FRAME) onOff(['exposeIframes'], updateExposeIframes);
|
if (IS_FRAME) {
|
||||||
|
updateExposeIframes();
|
||||||
|
onOff(['exposeIframes'], updateExposeIframes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +166,7 @@ self.INJECTED !== 1 && (() => {
|
||||||
const attr = 'stylus-iframe';
|
const attr = 'stylus-iframe';
|
||||||
const el = document.documentElement;
|
const el = document.documentElement;
|
||||||
if (!el) return; // got no styles so styleInjector didn't wait for <html>
|
if (!el) return; // got no styles so styleInjector didn't wait for <html>
|
||||||
if (!value || window === parent || !styleInjector.list.length) {
|
if (!value || !styleInjector.list.length) {
|
||||||
el.removeAttribute(attr);
|
el.removeAttribute(attr);
|
||||||
} else {
|
} else {
|
||||||
if (!parentDomain) parentDomain = await API.getTabUrlPrefix();
|
if (!parentDomain) parentDomain = await API.getTabUrlPrefix();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user