Skip to content

Instantly share code, notes, and snippets.

View ajingopi-bridge's full-sized avatar
🎯
Focusing

ajingopi-bridge

🎯
Focusing
View GitHub Profile
@ajingopi-bridge
ajingopi-bridge / es6-element-ready.js
Created December 30, 2020 07:15 — forked from jwilson8767/es6-element-ready.js
Wait for an element to exist. ES6, Promise, MutationObserver
// MIT Licensed
// Author: jwilson8767
/**
* Waits for an element satisfying selector to exist, then resolves promise with the element.
* Useful for resolving race conditions.
*
* @param selector
* @returns {Promise}
*/