From a7b7e6cc1a03b0c42e1a18e515f0f34bc705d002 Mon Sep 17 00:00:00 2001 From: bencroker Date: Tue, 22 Oct 2024 19:26:42 +0200 Subject: [PATCH] Compile JS --- src/resources/js/blitzInjectScript.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/resources/js/blitzInjectScript.js b/src/resources/js/blitzInjectScript.js index 4019ecb6..02178fca 100644 --- a/src/resources/js/blitzInjectScript.js +++ b/src/resources/js/blitzInjectScript.js @@ -7,7 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -window.addEventListener('{injectScriptEvent}', injectElements, { once: true }); +const injectScriptEvent = '{injectScriptEvent}'; +if (injectScriptEvent === 'load') { + window.addEventListener('load', injectElements, { once: true }); +} +else { + document.addEventListener(injectScriptEvent, injectElements, { once: true }); +} function injectElements() { return __awaiter(this, void 0, void 0, function* () { if (!document.dispatchEvent(new CustomEvent('beforeBlitzInjectAll', {