Async JS loading/evaluation

This commit is contained in:
Ian Gulliver
2018-11-21 15:27:01 +00:00
parent 2d077296a6
commit 12594d49b3
2 changed files with 9 additions and 3 deletions

View File

@@ -281,6 +281,12 @@ class PassMate {
}
}
document.addEventListener('DOMContentLoaded', () => {
function onReady() {
new PassMate(document.getElementsByTagName('body')[0]);
});
}
if (document.readyState === "loading") {
document.addEventListener('DOMContentLoaded', onReady);
} else {
onReady();
}