Listen to load events on window, not document

Related feedback:
- 0f330c7359 (r45774155)
This commit is contained in:
Raymond Hill 2021-01-08 13:11:09 -05:00
parent 07035789a4
commit 5fa873960f
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -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();
}