Created
September 3, 2017 14:50
-
-
Save szmeku/28091848a15e497903965920982ab188 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
| window.futureQuerySelectorAll = selector => new Promise(resolve => { | |
| let checkExist = setInterval(function() { | |
| if (document.querySelectorAll(selector).length > 0) { | |
| resolve(Array.from(document.querySelectorAll(selector))); | |
| clearInterval(checkExist); | |
| } | |
| }, 100); | |
| }); | |
| window.querySelectorAllAsArray = selector => Array.from(document.querySelectorAll(selector)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment