function waitFor_elementById (emlId: string) {
return new Promise(resolve => {
const $el = document.getElementById(emlId)
if ($el) return resolve($el)
const observer = new MutationObserver(mutations => {
const $el = document.getElementById(emlId)
if ($el) {
resolve($el)
observer.disconnect()
}
})
observer.observe(document.body, {
childList: true,
subtree: true
})
})
}