hterm: fix middle mouse button detection on CrOS
The match logic here will never produce 3 elements, so the 3rd index
will never match. Adjust the index so it properly matches on CrOS.
BUG=chromium:316275
Change-Id: I3f3799f4c0272db9f9f54a5bb8d3542cbe83e2ea
Reviewed-on: https://chromium-review.googlesource.com/509288
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/hterm/js/hterm_terminal.js b/hterm/js/hterm_terminal.js
index e0187e2..fe7b5ff 100644
--- a/hterm/js/hterm_terminal.js
+++ b/hterm/js/hterm_terminal.js
@@ -771,7 +771,7 @@
}
var ary = navigator.userAgent.match(/\(X11;\s+(\S+)/);
- if (!ary || ary[2] == 'CrOS') {
+ if (!ary || ary[1] == 'CrOS') {
this.mousePasteButton = 2;
} else {
this.mousePasteButton = 3;