Search code examples
firefoxweb-componentnative-web-component

Element.shadowRoot in firefox


How can we workaround Element.shadowRoot in Firefox since it is not available yet ?

About Element.shadowRoot https://developer.mozilla.org/en-US/docs/Web/API/Element/shadowRoot


Solution

  • You need to load the polyfills. But the shadowDOM Polyfill comes with some limitations.

    Personally I don't use shadowDOM yet unless I know I am going Chrome only.

    I am waiting for all of the major browsers to support it in their current version and previous version before I start using it all the time. That is probably a year to 18 months out.

    Here is info on the polyfills: https://www.webcomponents.org/polyfills