I’d like to test the browser support of web components. Thus I thought of doing it using:
if('define' in customElements) return true;
Is there a better or different way of doing this?
I’d like to test the browser support of web components. Thus I thought of doing it using:
if('define' in customElements) return true;
Is there a better or different way of doing this?
2
Answers
Maybe this: Detect if dom element is custom web component or html element
in most cases only web component will have shadow dom, might also be an option
You can also do this for better approach.