summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jordan Doyle <jordan@doyle.la> 2020-04-13 23:41:55 +0100
committerGravatar Jordan Doyle <jordan@doyle.la> 2020-04-13 23:41:55 +0100
commitd814663b9386ba1be573436b1397847e7e4d180a (patch)
tree86ac2c44a56bf5b7e0d896ad92b1efa94d18e41c
parentee582b24128b5c71068663711ea88486b70fd0e9 (diff)
Trigger DOMContentLoaded one tick after scripts are evaled
-rw-r--r--src/content/ScriptInterceptor.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/content/ScriptInterceptor.ts b/src/content/ScriptInterceptor.ts
index e607acb..8b502bd 100644
--- a/src/content/ScriptInterceptor.ts
+++ b/src/content/ScriptInterceptor.ts
@@ -167,10 +167,12 @@ export default new class ScriptInterceptor implements EventListenerObject {
}
}
- window.document.dispatchEvent(new Event("DOMContentLoaded", {
- bubbles: true,
- cancelable: true
- }));
+ setTimeout(() => {
+ window.document.dispatchEvent(new Event("DOMContentLoaded", {
+ bubbles: true,
+ cancelable: true
+ }));
+ }, 0);
}
/**