aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed')
-rw-r--r--ext/mixed/js/dynamic-loader.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/mixed/js/dynamic-loader.js b/ext/mixed/js/dynamic-loader.js
index 20ed8454..29672d36 100644
--- a/ext/mixed/js/dynamic-loader.js
+++ b/ext/mixed/js/dynamic-loader.js
@@ -48,12 +48,14 @@ const dynamicLoader = (() => {
}
function loadScriptSentinel(resolve, reject) {
+ const parent = document.body;
const script = document.createElement('script');
const sentinelEventName = 'dynamicLoaderSentinel';
const sentinelEventCallback = (e) => {
if (e.script !== script) { return; }
yomichan.off(sentinelEventName, sentinelEventCallback);
+ parent.removeChild(script);
resolve();
};
yomichan.on(sentinelEventName, sentinelEventCallback);
@@ -61,7 +63,7 @@ const dynamicLoader = (() => {
try {
script.async = false;
script.src = '/mixed/js/dynamic-loader-sentinel.js';
- document.body.appendChild(script);
+ parent.appendChild(script);
} catch (e) {
yomichan.off(sentinelEventName, sentinelEventCallback);
reject(e);