Skip to content

Instantly share code, notes, and snippets.

@sroehrl
Created January 11, 2020 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sroehrl/e77ddb9a36478c3ca2791cb1d04782a8 to your computer and use it in GitHub Desktop.
Save sroehrl/e77ddb9a36478c3ca2791cb1d04782a8 to your computer and use it in GitHub Desktop.
Handling customElements cross-browser
const _customElementsDefine = window.customElements.define;
window.customElements.define = (name, cl, conf) => {
if (!customElements.get(name)) {
_customElementsDefine.call(window.customElements, name, cl, conf);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment