Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js

Issue 2385343002: Make ChromeVox use child-index based offsets again for selection. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_) {
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698