CustomElementRegistry

Draft
This page is not complete.

The CustomElementRegistry interface provides methods for registering custom elements and querying registered elements.

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.

Methods

CustomElementRegistry.define()
Defines a new custom element.
CustomElementRegistry.get()
Returns the constuctor for the named custom element, or undefined if the custom element is not defined.
CustomElementRegistry.whenDefined()
Returns a 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.)

Examples

JS file:

// `window.customElements` is an instance of `CustomElementRegistry`
window.customElements instanceof CustomElementRegistry // true

Browser compatibility

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support No support 59.0 No support 47.0 10.1
Customized built-in elements No support 59.0 No support 47.0 No support
Feature Firefox Mobile (Gecko) Chrome for Android IE Mobile Opera Mobile Safari Mobile
Basic support No support 56.0 No support 47.0 10.1
Customized built-in elements No support 56.0 No support 47.0 No support

Document Tags and Contributors

 Contributors to this page: snuggs, daytonlowell, chrisdavidmills, arthurevans
 Last updated by: snuggs,