Created
September 30, 2024 07:19
-
-
Save MarkTiedemann/d4c9b736707a612f4c14d548af693377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const originalAttachShadow = Element.prototype.attachShadow; | |
Element.prototype.attachShadow = function attachShadow(...args) { | |
const detail = originalAttachShadow.apply(this, args); | |
this.dispatchEvent(new CustomEvent("shadowRootAttached", { detail })); | |
return detail; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment