Created
March 31, 2017 11:10
-
-
Save yavorski/5dc948378d214e6f0b3b6993ce4b93aa to your computer and use it in GitHub Desktop.
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
'use strict'; | |
if (!document.interactive) { | |
document.interactive = () => { | |
return new Promise((resolve) => { | |
if (document.readyState !== 'loading') { | |
resolve(); | |
} | |
else { | |
document.addEventListener('readystatechange', () => { | |
if (document.readyState === 'interactive') { | |
resolve(); | |
} | |
}); | |
} | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment