问题
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
回答1:
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
来源:https://stackoverflow.com/questions/50028945/element-shadowroot-in-firefox