Limited support Limited browser support. Check compatibility before use.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
146
146
26
146
26

The initialize() method of the CustomElementRegistry interface associates this registry with a DOM subtree, setting the Element.customElementRegistry of each inclusive descendant that doesn't already have one, and attempting to upgrade any custom elements found.

146
146
26
146
26

The customElementRegistry read-only property of the Document interface returns the CustomElementRegistry object associated with this document, or null if one has not been set.

146
146
150
26
146
26

The customElementRegistry read-only property of the Element interface returns the CustomElementRegistry object associated with this element, or null if one has not been set.

146
146
150
26
146
26

The shadowRootCustomElementRegistry property of the HTMLTemplateElement interface reflects the value of the shadowrootcustomelementregistry attribute of the associated element.

146
146
26
146
26

The customElementRegistry read-only property of the ShadowRoot interface returns the CustomElementRegistry object associated with this shadow root, or null if one has not been set.

146
146
150
26
146
26
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Notes 1 item(s)
Experimental
  • Requires an experimental browser flag to be enabled
Notes 1 item(s)
Experimental
  • Requires an experimental browser flag to be enabled
Notes 1 item(s)
Experimental
  • Requires an experimental browser flag to be enabled

Syntax

JAVASCRIPT
new CustomElementRegistry()

Use cases

  • Using Scoped custom element registries

    The CustomElementRegistry() constructor creates a new CustomElementRegistry object for scoped usage.

Cautions

  • Limited browser support. Check compatibility before use.

Implementation notes

  • Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.