Replace onLoad with addEventListener

Addresses #16
This commit is contained in:
Aristotelis Dossas
2020-04-22 17:32:31 +03:00
committed by GitHub
parent 3a289e30aa
commit 732e07e30d

View File

@@ -413,9 +413,9 @@ function initializeWhenReady(document) {
if (isBlacklisted()) {
return;
}
window.onload = () => {
window.addEventListener('load', () => {
initializeNow(window.document);
};
});
if (document) {
if (document.readyState === "complete") {
initializeNow(document);