Skip to content

Commit

Permalink
Init upon readystate interactive instead of complete (#10)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
mbergen and liquidely committed May 23, 2024
1 parent 7294d18 commit 73a1ebe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/scripts/ext.networknotice.Notice.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
} );
Expand Down

0 comments on commit 73a1ebe

Please sign in to comment.