Last active
August 21, 2017 14:34
-
-
Save ithinkihaveacat/cf40fef3cdab09c771a5625216eff575 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 injectScript(src) { | |
| return new Promise(resolve => { | |
| const e = document.createElement("script"); | |
| e.src = src; | |
| e.onload = resolve; | |
| document.head.appendChild(e); | |
| }); | |
| } | |
| // Example usage | |
| injectScript("https://unpkg.com/axe-core/axe.min.js").then(() => {; | |
| axe.a11yCheck(document, console.log.bind(console)); | |
| }); |
This file contains hidden or 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 injectScript(src) { | |
| return new Promise(resolve => { | |
| const e = document.createElement("script"); | |
| e.src = src; | |
| window.onSmartLockLoad = resolve; | |
| document.head.appendChild(e); | |
| }); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minified: