summaryrefslogtreecommitdiff
path: root/src/content/media.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/media.js')
-rw-r--r--src/content/media.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/content/media.js b/src/content/media.js
index 4b8f852..8a9526b 100644
--- a/src/content/media.js
+++ b/src/content/media.js
@@ -35,13 +35,11 @@ if ("MediaSource" in window) ns.on("capabilities", event => {
notifyPage();
if (mediaBlocker) {
- (async () => {
+ let exposedMime = `${mime} (MSE)`;
+ setTimeout(() => {
let me = Array.from(document.querySelectorAll("video,audio"))
.find(e => e.srcObject === ms || urls && urls.has(e.src));
-
if (!me) return;
- let exposedMime = `${mime} (MSE)`;
-
try {
let ph = PlaceHolder.create("media", request);
ph.replace(me);
@@ -49,7 +47,7 @@ if ("MediaSource" in window) ns.on("capabilities", event => {
} catch (e) {
error(e);
}
- })();
+ }, 0);
throw new Error(`${exposedMime} blocked by NoScript`);
}