New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 9 users

Issue metadata

Status: Fixed
Closed: Oct 2015
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Sign in to add a comment

Issue 475868: document.queryCommandSupported('copy') is false when executed from Devtools

Reported by, Apr 10 2015 Project Member

Issue description

Version: 44.0.2358.0 (Official Build) canary (64-bit)

What steps will reproduce the problem?
1. Go to any random page in Chrome version 44
2. Open Devtools and go to the console
3. run the command document.queryCommandSupported('copy');

What is the expected output? What do you see instead?
The response should be true, instead it's false. However running code in a jsbin, the API actually returns true. There is a mis-match between these two uses of the API.

Comment 1 by, Apr 13 2015

Labels: -Cr-Blink Cr-Blink-Editing

Comment 2 by, Apr 13 2015

current implementation of queryCommandSupported() check whether javaScript can access clipboard. As it is not allowed it is returning false.

queryCommandSupported() should only check whether command is present in CommandMap. If it is supported queryCommandEnabled() should check whether is it actually available to use.

Comment 3 by, Apr 16 2015


Comment 4 by, Apr 16 2015

@ mattgaunt
On Version 44.0.2371.0 canary (64-bit) windows 7
I ran document.queryCommandSupported('copy'); through it is returning FALSE. If u run document.queryCommandSupported('copy'); through console also it is returning FALSE.

Behavior is identical in both scenarios, Could you please verify once again ?

Comment 5 by, Apr 16 2015

Yup everything is now false.

This is while I raised this bug:

My fear is that  issue 476508  will be fixed and then Devtools will start returning a different value again.

Either close this bug or block it on the other issue and treat this bug as nothing more than a confirmation that Devtools is doing the right thing.

Comment 6 by, Jun 2 2015

I would agree that this bug should be considered blocked on  issue 476508 .

Comment 7 by, Aug 11 2015

Status: Available

Comment 8 by, Oct 15 2015

Status: Started
In review: In review:

Comment 9 by, Oct 15 2015

Project Member
The following revision refers to this bug:

commit bf9013658c0eb493db5dd0941532160dc9fdd0c7
Author: yosin <>
Date: Thu Oct 15 09:18:52 2015

Make queryCommandSupported(copy|cut|paste) always return true

This patch makes |document.queryCommandSupported(name)| always return true for
"Copy", "Cut", and "Paste" commands to follow the editing API specification.

Before this patch, |queryCommandSupported()| returns value based on clipboard
accessibility, e.g. "clipboardRead" and "clipboardWrite" permission in Chrome
extensions. This behavior ins't compatible with the editing specification and
its intention. |queryCommandSupported()| should returns true for command
which can be passed to |execCommand()|, and other |queryCommandXXX()|.

Here is a table of return value of |execute()| and |isEnabled()| with
clipboard access permission and Editor.canCopy/Cut/Paste

Can R/W   Editor.can isEnabled execute
Clipboard Copy/Paste
true      true       true      true
true      false      false     true
false     true       false     false
false     false      false     false

BUG= 476508 ,  475868 

Review URL:

Cr-Commit-Position: refs/heads/master@{#354240}


Comment 10 by, Oct 16 2015

Status: Fixed

Sign in to add a comment