Skip to content

Instantly share code, notes, and snippets.

Avatar

Julien-laville

View GitHub Profile
View gist:6dde02f8c125e3de377e7709799b7c73
function waitForSelector(selector,cb, limit = 30) {
if(limit === 0) return
if(document.querySelector(selector)) {
cb()
} else {
setTimeout(() => {waitForSelector(selector,cb, limit --)},300)
}
}
You can’t perform that action at this time.