EmbyCrackedClient/web/modules/customelementupgrade.js
2025-06-25 11:46:04 +08:00

1 line
No EOL
359 B
JavaScript

import dom from"./dom.js";function waitForUpgradeWithEvent(elem){return new Promise(function(resolve,reject){elem.__upgraded?resolve():dom.addEventListener(elem,"upgraded",function(){elem.__upgraded=!0,resolve()},{once:!0})})}HTMLElement.prototype.waitForCustomElementUpgrade=function(){return this.__upgraded?Promise.resolve():waitForUpgradeWithEvent(this)};