Untitled
unknown
plain_text
a year ago
1.1 kB
12
Indexable
(function () {
try {
/* main variables */
var debug = 0;
var variation_name = "";
var $;
/* all Pure helper functions */
function waitForElement(selector, trigger, delayInterval, delayTimeout) {
var interval = setInterval(function () {
if (
document &&
document.querySelector(selector) &&
document.querySelectorAll(selector).length > 0
) {
clearInterval(interval);
trigger();
}
}, delayInterval);
setTimeout(function () {
clearInterval(interval);
}, delayTimeout);
}
let egstring = `<div>
<div></div>
</div>`
/* Variation Init */
function init() {
let selector = document.querySelector('#NavDrawer .drawer__scrollable');
selector.insertAdjacentHTML('beforebegin', egstring);
}
/* Initialize variation */
waitForElement('#NavDrawer .drawer__scrollable', init, 50, 15000);
} catch (e) {
if (debug) console.log(e, "error in Test" + variation_name);
}
})();
Editor is loading...
Leave a Comment