Draft
This page is not complete.
The CustomElementRegistry
interface provides methods for registering custom elements and querying registered elements. It can be accessed with window.customElements
.
This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
CustomElementRegistry.define()
CustomElementRegistry.get()
undefined
if the custom element is not defined.CustomElementRegistry.whenDefined()
promise
that will be fulfilled when a custom element becomes defined with the given name. (If such a custom element is already defined, the returned promise is immediately fulfilled.)// `window.customElements` is an instance of `CustomElementRegistry` window.customElements instanceof CustomElementRegistry // true
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'CustomElementRegistry' in that specification. | Living Standard | Initial definition. |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic support | 561 | 611 | No2 | ? | No | No | 10.11 |
1. Supports 'Autonomous custom elements' but not 'Customized built-in elements'
2. Under consideration
3. This feature is behind the dom.webcomponents.enabled
preference (needs to be set to true
). To change preferences in Firefox, visit about:config.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry