1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 12:57:57 +02:00

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) ) { 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' ) { } else if ( document.readyState === 'loading' ) {
document.addEventListener('DOMContentLoaded', start, { once: true }); self.addEventListener('DOMContentLoaded', start, { once: true });
} else { } else {
start(); start();
} }