Firefox Tomorrow

web api interface

CustomElementRegistry

View on MDN ↗

The CustomElementRegistry interface provides methods for registering custom elements and querying registered elements. To get an instance of it, use the customElements property. To create a scoped registry, use the CustomElementRegistry() constructor.

Constructor

Instance methods

  • define()
  • get()
    • : Returns the constructor for the named custom element, or undefined if the custom element is not defined.
  • getName()
    • : Returns the name for the already-defined custom element, or null if the custom element is not defined.
  • upgrade()
    • : Upgrades a custom element directly, even before it is connected to its shadow root.
  • initialize()
    • : Associates a scoped registry with a DOM subtree, setting the custom element registry on each inclusive descendant and upgrading any custom elements.
  • whenDefined()
    • : Returns an empty Promise that resolves 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

See the Examples section in our guide to using custom elements.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.