From 0158b36e4d512d940a8ea6c1cd796874ba2bca60 Mon Sep 17 00:00:00 2001 From: mbergen Date: Thu, 23 May 2024 11:47:58 +0200 Subject: [PATCH 1/2] Init upon readystate interactive instead of complete --- 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..edb3858 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 ( document.readyState === 'interactive' ) { init(); } else { document.addEventListener( 'readystatechange', () => { - if ( document.readyState === 'complete' ) { + if ( document.readyState === 'interactive' ) { init(); } } ); From fdad29665a0a5fd36aef539cd8cb2ee60c6a5de7 Mon Sep 17 00:00:00 2001 From: mbergen Date: Thu, 23 May 2024 14:45:06 +0200 Subject: [PATCH 2/2] Check for interactive or complete readystate 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 edb3858..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 === 'interactive' ) { + if ( [ 'interactive', 'complete' ].includes( document.readyState ) ) { init(); } else { document.addEventListener( 'readystatechange', () => { - if ( document.readyState === 'interactive' ) { + if ( [ 'interactive', 'complete' ].includes( document.readyState ) ) { init(); } } );