Skip to content

Commit

Permalink
Listen to load events on window, not document
Browse files Browse the repository at this point in the history
Related feedback:
- 0f330c7#r45774155
  • Loading branch information
gorhill committed Jan 8, 2021
1 parent 0703578 commit 5fa8739
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/resources/scriptlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,9 @@
});
};
if ( document.readyState !== 'complete' && /\bcomplete\b/.test(behavior) ) {
document.addEventListener('load', start, { once: true });
self.addEventListener('load', start, { once: true });
} else if ( document.readyState === 'loading' ) {
document.addEventListener('DOMContentLoaded', start, { once: true });
self.addEventListener('DOMContentLoaded', start, { once: true });
} else {
start();
}
Expand Down

0 comments on commit 5fa8739

Please sign in to comment.