Chromium Code Reviews| Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js |
| diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js |
| index 4bf888349ae92e06c16f0e3ef46864f8823b9852..776d2b8e8b650a3b17d59c35d53d90ecf1322f05 100644 |
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js |
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js |
| @@ -509,15 +509,17 @@ CommandHandler.onCommand = function(command) { |
| output.withString(target.docUrl || '').go(); |
| return false; |
| case 'copy': |
| - var textarea = document.createElement('textarea'); |
| - document.body.appendChild(textarea); |
| - textarea.focus(); |
| - document.execCommand('paste'); |
| - var clipboardContent = textarea.value; |
| - textarea.remove(); |
| - cvox.ChromeVox.tts.speak( |
| - Msgs.getMsg('copy', [clipboardContent]), cvox.QueueMode.FLUSH); |
| - ChromeVoxState.instance.pageSel_ = null; |
| + window.setTimeout(function() { |
|
dmazzoni
2016/10/05 18:25:33
Have you looked into this API, would it work?
htt
David Tseng
2016/10/10 20:03:21
This didn't work for me when I first tried it a wh
|
| + var textarea = document.createElement('textarea'); |
| + document.body.appendChild(textarea); |
| + textarea.focus(); |
| + document.execCommand('paste'); |
| + var clipboardContent = textarea.value; |
| + textarea.remove(); |
| + cvox.ChromeVox.tts.speak( |
| + Msgs.getMsg('copy', [clipboardContent]), cvox.QueueMode.FLUSH); |
| + ChromeVoxState.instance.pageSel_ = null; |
| + }, 20); |
| return true; |
| case 'toggleSelection': |
| if (!ChromeVoxState.instance.pageSel_) { |