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', {