Created
May 23, 2019 20:39
-
-
Save brendandahl/c8f54e9edbac0388323bbd9cbf576227 to your computer and use it in GitHub Desktop.
Log the load events of a document.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const domContentLoadedPromise = new Promise(resolve => { | |
window.addEventListener("DOMContentLoaded", () => { | |
dump(">>> dialog - DOMContentLoaded event" + window.document.documentURI + "\n"); | |
resolve(); | |
}, { capture: true, once: true }); | |
}); | |
domContentLoadedPromise.then(() => { | |
dump(">>> dialog - Promise for domContentLoadedPromise resolved\n"); | |
}); | |
window.addEventListener("load", () => { | |
dump(">>> dialog - load event\n") | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment