Cette traduction est incomplète. Aidez à traduire cet article depuis l'anglais.

Brouillon
Cette page n'est pas terminée.

The CustomElementRegistry interface provides methods for registering custom elements and querying registered elements. It can be accessed with window.customElements.

Cette fonction est expérimentale
Puisque cette fonction est toujours en développement dans certains navigateurs, veuillez consulter le tableau de compatibilité pour les préfixes à utiliser selon les navigateurs.
Il convient de noter qu'une fonctionnalité expérimentale peut voir sa syntaxe ou son comportement modifié dans le futur en fonction des évolutions de la spécification.

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

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

Specifications

Specification Status Comment
HTML Living Standard
La définition de 'CustomElementRegistry' dans cette spécification.
Standard évolutif Initial definition.

Browser compatibility

 

Update compatibility data on GitHub
OrdinateurMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariWebview AndroidChrome pour AndroidEdge MobileFirefox pour AndroidOpera pour AndroidSafari sur iOSSamsung Internet
Support simple
Expérimentale
Chrome Support complet 54Edge Aucun support Non
Notes
Aucun support Non
Notes
Notes In Development
Firefox Support complet 63
Support complet 63
Aucun support 59 — 65
Désactivée
Désactivée From version 59 until version 65 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Aucun support ? — 59
Désactivée
Désactivée Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE Aucun support NonOpera Support complet 41Safari Support complet 10.1WebView Android Support complet 54Chrome Android Support complet 54Edge Mobile Aucun support Non
Notes
Aucun support Non
Notes
Notes In Development
Firefox Android Support complet 63
Support complet 63
Aucun support 59 — 65
Désactivée
Désactivée From version 59 until version 65 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Aucun support ? — 59
Désactivée
Désactivée Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Support complet 41Safari iOS Support complet 10.1Samsung Internet Android Support complet 6.0
Customized built-in element support
Expérimentale
Chrome Support complet 66Edge Aucun support NonFirefox Support complet 63
Support complet 63
Aucun support 59 — 65
Désactivée
Désactivée From version 59 until version 65 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Aucun support ? — 59
Désactivée
Désactivée Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE Aucun support NonOpera Support complet 53Safari Aucun support NonWebView Android Support complet 66Chrome Android Support complet 66Edge Mobile Aucun support NonFirefox Android Support complet 63
Support complet 63
Aucun support 59 — 65
Désactivée
Désactivée From version 59 until version 65 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Aucun support ? — 59
Désactivée
Désactivée Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Support complet 53Safari iOS Aucun support NonSamsung Internet Android Aucun support Non
define
Expérimentale
Chrome Support complet 66
Notes
Support complet 66
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 54
Notes
Notes Support for 'Autonomous custom elements' only.
Edge Aucun support Non
Notes
Aucun support Non
Notes
Notes In Development
Firefox Support complet 63
Support complet 63
Aucun support 59 — 65
Désactivée
Désactivée From version 59 until version 65 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Aucun support ? — 59
Désactivée
Désactivée Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE Aucun support NonOpera Support complet 53
Notes
Support complet 53
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 41
Notes
Notes Support for 'Autonomous custom elements' only.
Safari Support complet 10.1
Notes
Support complet 10.1
Notes
Notes Supports 'Autonomous custom elements' but not 'Customized built-in elements'
WebView Android Support complet 66
Notes
Support complet 66
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 54
Notes
Notes Support for 'Autonomous custom elements' only.
Chrome Android Support complet 66
Notes
Support complet 66
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 54
Notes
Notes Support for 'Autonomous custom elements' only.
Edge Mobile Aucun support Non
Notes
Aucun support Non
Notes
Notes In Development
Firefox Android Support complet 63
Support complet 63
Aucun support 59 — 65
Désactivée
Désactivée From version 59 until version 65 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Aucun support ? — 59
Désactivée
Désactivée Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Support complet 53
Notes
Support complet 53
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 41
Notes
Notes Support for 'Autonomous custom elements' only.
Safari iOS Support complet 10.1
Notes
Support complet 10.1
Notes
Notes Supports 'Autonomous custom elements' but not 'Customized built-in elements'
Samsung Internet Android Support complet 6.0
Notes
Support complet 6.0
Notes
Notes Support for 'Autonomous custom elements' only.
get
Expérimentale
Chrome Support complet 66
Notes
Support complet 66
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 54
Notes
Notes Support for 'Autonomous custom elements' only.
Edge Aucun support Non
Notes
Aucun support Non
Notes
Notes In Development
Firefox Support complet 63
Support complet 63
Aucun support 59 — 65
Désactivée
Désactivée From version 59 until version 65 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Aucun support ? — 59
Désactivée
Désactivée Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE Aucun support NonOpera Support complet 53
Notes
Support complet 53
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 41
Notes
Notes Support for 'Autonomous custom elements' only.
Safari Support complet 10.1
Notes
Support complet 10.1
Notes
Notes Supports 'Autonomous custom elements' but not 'Customized built-in elements'
WebView Android Support complet 66
Notes
Support complet 66
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 54
Notes
Notes Support for 'Autonomous custom elements' only.
Chrome Android Support complet 66
Notes
Support complet 66
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 54
Notes
Notes Support for 'Autonomous custom elements' only.
Edge Mobile Aucun support Non
Notes
Aucun support Non
Notes
Notes In Development
Firefox Android Support complet 63
Support complet 63
Aucun support 59 — 65
Désactivée
Désactivée From version 59 until version 65 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Aucun support ? — 59
Désactivée
Désactivée Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Support complet 53
Notes
Support complet 53
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 41
Notes
Notes Support for 'Autonomous custom elements' only.
Safari iOS Support complet 10.1
Notes
Support complet 10.1
Notes
Notes Supports 'Autonomous custom elements' but not 'Customized built-in elements'
Samsung Internet Android Support complet 6.0
Notes
Support complet 6.0
Notes
Notes Support for 'Autonomous custom elements' only.
upgrade
Expérimentale
Chrome Support complet 68Edge ? Firefox ? IE ? Opera Support complet 55Safari ? WebView Android Support complet 68Chrome Android Support complet 68Edge Mobile ? Firefox Android ? Opera Android Support complet 55Safari iOS ? Samsung Internet Android ?
whenDefined
Expérimentale
Chrome Support complet 66
Notes
Support complet 66
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 54
Notes
Notes Support for 'Autonomous custom elements' only.
Edge Aucun support Non
Notes
Aucun support Non
Notes
Notes In Development
Firefox Support complet 63
Support complet 63
Aucun support 59 — 65
Désactivée
Désactivée From version 59 until version 65 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Aucun support ? — 59
Désactivée
Désactivée Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
IE Aucun support NonOpera Support complet 53
Notes
Support complet 53
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 41
Notes
Notes Support for 'Autonomous custom elements' only.
Safari Support complet 10.1
Notes
Support complet 10.1
Notes
Notes Supports 'Autonomous custom elements' but not 'Customized built-in elements'
WebView Android Support complet 66
Notes
Support complet 66
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 54
Notes
Notes Support for 'Autonomous custom elements' only.
Chrome Android Support complet 66
Notes
Support complet 66
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 54
Notes
Notes Support for 'Autonomous custom elements' only.
Edge Mobile Aucun support Non
Notes
Aucun support Non
Notes
Notes In Development
Firefox Android Support complet 63
Support complet 63
Aucun support 59 — 65
Désactivée
Désactivée From version 59 until version 65 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Aucun support ? — 59
Désactivée
Désactivée Until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
Opera Android Support complet 53
Notes
Support complet 53
Notes
Notes Support for 'Customized built-in elements' as well.
Support complet 41
Notes
Notes Support for 'Autonomous custom elements' only.
Safari iOS Support complet 10.1
Notes
Support complet 10.1
Notes
Notes Supports 'Autonomous custom elements' but not 'Customized built-in elements'
Samsung Internet Android Support complet 6.0
Notes
Support complet 6.0
Notes
Notes Support for 'Autonomous custom elements' only.

Légende

Support complet  
Support complet
Aucun support  
Aucun support
Compatibilité inconnue  
Compatibilité inconnue
Fonctionnalité expérimentale. Celle-ci peut être amenée à changer par la suite.
Fonctionnalité expérimentale. Celle-ci peut être amenée à changer par la suite.
Voir les notes d'implémentation.
Voir les notes d'implémentation.
Une action explicite de l'utilisateur est nécessaire pour activer cette fonctionnalité.
Une action explicite de l'utilisateur est nécessaire pour activer cette fonctionnalité.

 

Étiquettes et contributeurs liés au document

Contributeurs à cette page : fscholz
Dernière mise à jour par : fscholz,