Better reflect event firing order in soft reload emulation.

This commit is contained in:
hackademix 2020-09-14 22:50:29 +02:00
parent 2b083358c7
commit dde5c938f3
1 changed files with 3 additions and 3 deletions

View File

@ -96,15 +96,15 @@
}
debug("ALl scripts done, firing completion events.");
document.dispatchEvent(new Event("readystatechange"));
if (document.documentElement instanceof SVGElement) {
document.documentElement.dispatchEvent(new Event("SVGLoad"));
}
document.dispatchEvent(new Event("DOMContentLoaded", {
bubbles: true,
cancelable: true
}));
if (document.readyState === "complete") {
window.dispatchEvent(new Event("load"));
if (document.documentElement instanceof SVGElement) {
document.documentElement.dispatchEvent(new Event("SVGLoad"));
}
}
})();
} catch (e) {