Created
April 3, 2018 16:41
-
-
Save cedeber/870afa3b1d441f40a4253e1f302d1eca to your computer and use it in GitHub Desktop.
Page loaded
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
function pageLoaded() { | |
return new Promise(resolve => { | |
if (document.readyState === "complete") { | |
resolve(); | |
} else { | |
window.addEventListener("load", () => { | |
resolve(); | |
}); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment