Skip to content

Commit

Permalink
Check for interactive or complete readystate
Browse files Browse the repository at this point in the history
Co-authored-by: Laura van Helvoort <[email protected]>
  • Loading branch information
mbergen and liquidely authored May 23, 2024
1 parent 0158b36 commit fdad296
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 === 'interactive' ) {
if ( [ 'interactive', 'complete' ].includes( document.readyState ) ) {
init();
} else {
document.addEventListener( 'readystatechange', () => {
if ( document.readyState === 'interactive' ) {
if ( [ 'interactive', 'complete' ].includes( document.readyState ) ) {
init();
}
} );
Expand Down

0 comments on commit fdad296

Please sign in to comment.