mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-08 16: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 () {
|
||||
contentScript?.unregister();
|
||||
await contentScript?.unregister();
|
||||
}
|
||||
|
||||
|
||||
registerMediaOverlayContentScript();
|
||||
|
||||
options.addEventListener("changed", ev => {
|
||||
options.addEventListener("changed", async ev => {
|
||||
const alteredOpts = ev.detail;
|
||||
|
||||
if (alteredOpts.includes("mediaOverlayEnabled")) {
|
||||
unregisterMediaOverlayContentScript();
|
||||
registerMediaOverlayContentScript();
|
||||
await unregisterMediaOverlayContentScript();
|
||||
await registerMediaOverlayContentScript();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user