From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/document/querycommandsupported/index.html | 125 +++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 files/fr/web/api/document/querycommandsupported/index.html (limited to 'files/fr/web/api/document/querycommandsupported') diff --git a/files/fr/web/api/document/querycommandsupported/index.html b/files/fr/web/api/document/querycommandsupported/index.html new file mode 100644 index 0000000000..a46e4374d5 --- /dev/null +++ b/files/fr/web/api/document/querycommandsupported/index.html @@ -0,0 +1,125 @@ +--- +title: Document.queryCommandSupported() +slug: Web/API/Document/queryCommandSupported +tags: + - API + - Commandes + - DOM + - Document + - Méthodes + - editeur +translation_of: Web/API/Document/queryCommandSupported +--- +
{{ApiRef("DOM")}}
+ +

La méthode Document.queryCommandSupported() indique si la commande d'éditeur spécifiée est prise en charge par le navigateur.

+ +

Syntaxe

+ +
isSupported = document.queryCommandSupported(command);
+
+ +
+
+

Paramètres

+
+
command
+
La commande pour laquelle on veut déterminer si elle est prise en charge.
+
+ +

Valeur de retour

+ +

Renvoie un {{jsxref("Boolean")}} qui est true (vrai) si la commande est prise en charge et false (faux) sinon.

+ +

Notes

+ +

La commande 'paste' (coller) renvoie false (faux), pas seulement si la fonctionnalité n'est pas disponible, mais également si le script l'appelant a des privilèges insuffisants pour réaliser l'action [1].

+ +

Exemple

+ +
var flg = document.queryCommandSupported("SelectAll");
+
+if(flg) {
+  // ...Faire quelque chose
+}
+
+ +

Spécifications

+ + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('HTML Editing','#querycommandsupported()','querycommandsupported')}}{{Spec2('HTML Editing')}}Définition initiale.
+ +

Compatibilité des navigateurs

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FonctionnalitéChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support17{{CompatVersionUnknown}}{{CompatGeckoDesktop("9.0")}}[1]4.0{{CompatUnknown}}6.1.6
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FonctionnalitéAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("9.0")}}[1]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

[1] Avant Firefox 41, pour la commande 'paste' (coller), Firefox renvoyait incorrectement true (vrai) quand la fonctionnalité coller était disponible même si le script appelant avait des privilèges insuffisants pour réaliser l'action.

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf