From 771d6836cc0f3c50c1b49e714b8c4c6a02765044 Mon Sep 17 00:00:00 2001 From: pattonwebz Date: Mon, 9 Dec 2024 18:47:24 +0000 Subject: [PATCH] Add a later listener on 'load' to retry init incase it didn't run on DOMContentLoaded --- src/frontendHighlighterApp/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontendHighlighterApp/index.js b/src/frontendHighlighterApp/index.js index 458c7073..33183f77 100644 --- a/src/frontendHighlighterApp/index.js +++ b/src/frontendHighlighterApp/index.js @@ -907,3 +907,7 @@ const initHighlighter = () => { window.addEventListener( 'DOMContentLoaded', () => { initHighlighter(); } ); +// Add a listener later than DOMCOntentLoaded to check if the init has run. +window.addEventListener( 'load', () => { + initHighlighter(); +} );