From 73a1ebed40c37bec7333e78b90d3cf55723eff87 Mon Sep 17 00:00:00 2001 From: mbergen Date: Thu, 23 May 2024 16:11:53 +0200 Subject: [PATCH] Init upon readystate interactive instead of complete (#10) * Init upon readystate interactive instead of complete * Check for interactive or complete readystate Co-authored-by: Laura van Helvoort <105433238+liquidely@users.noreply.github.com> --------- Co-authored-by: Laura van Helvoort <105433238+liquidely@users.noreply.github.com> --- resources/scripts/ext.networknotice.Notice.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/scripts/ext.networknotice.Notice.js b/resources/scripts/ext.networknotice.Notice.js index d1c2be5..8f67d46 100644 --- a/resources/scripts/ext.networknotice.Notice.js +++ b/resources/scripts/ext.networknotice.Notice.js @@ -47,11 +47,11 @@ /** * Check on document readyState */ - if ( document.readyState === 'complete' ) { + if ( [ 'interactive', 'complete' ].includes( document.readyState ) ) { init(); } else { document.addEventListener( 'readystatechange', () => { - if ( document.readyState === 'complete' ) { + if ( [ 'interactive', 'complete' ].includes( document.readyState ) ) { init(); } } );