mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-10 17:49:58 +00:00
Make media overlay content script re-registration sequential
This commit is contained in:
@@ -529,18 +529,18 @@ async function initMediaOverlay () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function unregisterMediaOverlayContentScript () {
|
async function unregisterMediaOverlayContentScript () {
|
||||||
contentScript?.unregister();
|
await contentScript?.unregister();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
registerMediaOverlayContentScript();
|
registerMediaOverlayContentScript();
|
||||||
|
|
||||||
options.addEventListener("changed", ev => {
|
options.addEventListener("changed", async ev => {
|
||||||
const alteredOpts = ev.detail;
|
const alteredOpts = ev.detail;
|
||||||
|
|
||||||
if (alteredOpts.includes("mediaOverlayEnabled")) {
|
if (alteredOpts.includes("mediaOverlayEnabled")) {
|
||||||
unregisterMediaOverlayContentScript();
|
await unregisterMediaOverlayContentScript();
|
||||||
registerMediaOverlayContentScript();
|
await registerMediaOverlayContentScript();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user