Closed parasharrajat closed 4 years ago
I think you're using the wrong polyfill, try this one instead.
Sorry for this issue.
I just found out that chrome does not support custom-elements for the content-scripts. So I am using polyfill @webcomponents/custom-elements
as a work around.
Thanks for such an awesome framework or Tagged templates Literals.
In ABP (million users) we use HyperHTMLELement with this polyfill, and it's been 2+ years, and we cover pretty much every old to modern browser.
That being said, I can't remember if we use it in content script, but you need to change polyfill and/or file an issue to the polyfill you are using, as there's nothing I can do here, if that polyfill doesn't work as expected.
My polyfills, both of them, should work though, specially the latter one, as I think content script allows MutationObserver, and that's what the first suggested polyfill is based on.
P.S. if you'd like to know more about the history of my polyfills, those that have been deployed the most in production, this blog post might help https://medium.com/@WebReflection/some-custom-elements-update-376317dd7862 👋
I am creating a browser extension and I am using HyperHTML for content-scripts. Normally with
bind
everythings works but for encapsulation I want to tryhyperHTML-elment
. I am getting this error on console.Source code is
I found the root casue here
customElements
is null hereMy browser is