document.queryCommandSupported() is a deprecated, non-standard instance method that reports whether a named editor command exists in the browser (see MDN Document: queryCommandSupported()). Learn the boolean return value, the MDN SelectAll pattern, paste privilege notes, how it differs from queryCommandEnabled() and queryCommandState(), and five try-it labs.
01
Kind
Instance method
02
Args
command string
03
Returns
boolean
04
Pairs with
execCommand
05
Status
Deprecated
06
Also
Non-standard
Fundamentals
Introduction
Before a legacy toolbar offers bold or SelectAll, it often asks: “Does this browser even know that command?” document.queryCommandSupported() answers that question.
MDN: the method reports whether or not the specified editor command is supported by the browser. If you still use deprecated execCommand(), MDN suggests checking with queryCommandSupported() for compatibility.
💡
Think: “Does this browser know the command?”
1) Pick a command name (e.g. "SelectAll") 2) Call document.queryCommandSupported(command) 3) If true, optionally run execCommand / further checks 4) Remember paste can be false for privilege reasons (MDN)
Document.queryCommandSupported() is Deprecated and Non-standard on MDN (not part of any current specification). Logos use the shared browser-image-sprite.png sprite from this project. Still present in many engines for legacy editing, but do not build new products on it.
✓ Deprecated · Non-standard
Document.queryCommandSupported()
Legacy support probe for editor commands — still seen with old toolbars; prefer modern editors and the Clipboard API.
LegacyNot for new apps
Google ChromeLegacy editing probe still present — avoid for new apps
Legacy
Mozilla FirefoxLegacy path; paste often restricted — avoid for new apps
Legacy
Apple SafariLegacy editing support; verify each command
Legacy
Microsoft EdgeChromium legacy path — avoid for new code
Legacy
OperaFollow Chromium legacy behavior
Legacy
Internet ExplorerHistoric rich-text path only
Legacy
queryCommandSupported()Avoid
Bottom line: Learn it for legacy execCommand toolbars and interviews. For new clipboard and rich-text UX, prefer modern APIs and editor libraries.
Wrap Up
Conclusion
document.queryCommandSupported(command) returns a boolean telling you whether a legacy editor command exists in the browser. MDN marks it deprecated and non-standard. Use it only when maintaining execCommand-based UIs; for new apps, choose modern editors and the Clipboard API.
Check support before calling legacy execCommand (MDN)
Treat paste false as possibly a privilege issue (MDN)
Prefer the Clipboard API for new copy / paste UX
Compare with enabled and state when debugging toolbars
❌ Don’t
Build a new rich-text product on queryCommand* + execCommand
Assume supported means enabled or already applied
Treat paste: false as “unsupported only”
Skip browser testing — command matrices differ
Ignore that the whole editing command family is non-standard
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about queryCommandSupported()
Legacy support probe for editor commands — know it, rarely ship it.
5
Core concepts
📝01
Returns
boolean
MDN
⚠️02
Status
Deprecated
MDN
🛡03
Also
Non-standard
MDN
📋04
Pairs with
execCommand
legacy
📋05
paste
privileges
MDN note
❓ Frequently Asked Questions
MDN: Document.queryCommandSupported() reports whether or not the specified editor command is supported by the browser. It returns true if supported and false if not.
Yes. MDN marks Document.queryCommandSupported() as Deprecated and Non-standard. It is not part of any current specification and is no longer on track to become a standard.
MDN: if you still use deprecated execCommand() for a rare reason, consider checking the command with queryCommandSupported() to ensure compatibility. Prefer modern APIs for new products.
queryCommandSupported() asks whether the browser knows the command at all. queryCommandEnabled() asks whether that command is currently enabled (for example, cut/copy often need a user-initiated thread).
queryCommandState() asks whether the command’s formatting is already applied to the current selection (true, false, or null). queryCommandSupported() only asks about browser support.
MDN: the paste command returns false not only if the feature is unavailable, but also if the script calling it has insufficient privileges to perform the action.
Did you know?
MDN pairs this method with deprecated execCommand() the same way it pairs queryCommandEnabled(): if you still call execCommand, check support first. Supported asks “does it exist?”; enabled asks “can I run it now?”