summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornzolghadr <nzolghadr@chromium.org>2016-09-21 09:05:47 (GMT)
committerCommit bot <commit-bot@chromium.org>2016-09-21 09:08:53 (GMT)
commitc2f7d5c86864715dc770bbc295a68c6ee7297f38 (patch)
tree7d2e5f9394f6ee4acc0784c00c052543b0050494
parentec3b2760c702a5d913a2621e9f22205e74e33622 (diff)
downloadchromium-c2f7d5c86864715dc770bbc295a68c6ee7297f38.tar.gz
chromium-c2f7d5c86864715dc770bbc295a68c6ee7297f38.tar.xz
Only handle click actions for left & middle buttons
Change chrome pages to handle actions for left and middle button click only. BUG=645865 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2337513002 Cr-Commit-Position: refs/heads/master@{#420011}
-rw-r--r--chrome/browser/resources/history/other_devices.js2
-rw-r--r--chrome/browser/resources/md_downloads/crisper.js1
-rw-r--r--chrome/browser/resources/ntp4/new_tab.js2
-rw-r--r--ui/webui/resources/js/util.js2
4 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/resources/history/other_devices.js b/chrome/browser/resources/history/other_devices.js
index c4c04a5..2ba6f76 100644
--- a/chrome/browser/resources/history/other_devices.js
+++ b/chrome/browser/resources/history/other_devices.js
@@ -286,6 +286,8 @@ Device.prototype.createSessionContents_ = function(maxNumTabs) {
// turns.
function makeClickHandler(sessionTag, windowId, tabId) {
return function(e) {
+ if (e.button > 1)
+ return; // Ignore buttons other than left and middle.
recordUmaEvent_(HISTOGRAM_EVENT.LINK_CLICKED);
chrome.send('openForeignSession', [sessionTag, windowId, tabId,
e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]);
diff --git a/chrome/browser/resources/md_downloads/crisper.js b/chrome/browser/resources/md_downloads/crisper.js
index 6cb4e37..32a08ed 100644
--- a/chrome/browser/resources/md_downloads/crisper.js
+++ b/chrome/browser/resources/md_downloads/crisper.js
@@ -648,6 +648,7 @@ function queryRequiredElement(selectors, opt_context) {
[ 'click', 'auxclick' ].forEach(function(eventName) {
document.addEventListener(eventName, function(e) {
+ if (e.button > 1) return;
if (e.defaultPrevented) return;
var eventPath = e.path;
var anchor = null;
diff --git a/chrome/browser/resources/ntp4/new_tab.js b/chrome/browser/resources/ntp4/new_tab.js
index 821ab15..28fed8f 100644
--- a/chrome/browser/resources/ntp4/new_tab.js
+++ b/chrome/browser/resources/ntp4/new_tab.js
@@ -160,6 +160,8 @@ cr.define('ntp', function() {
* @param {Event} e The click/auxclick event.
*/
function onChromeWebStoreButtonClick(e) {
+ if (e.button > 1)
+ return; // Ignore buttons other than left and middle.
chrome.send('recordAppLaunchByURL',
[encodeURIComponent(this.href),
ntp.APP_LAUNCH.NTP_WEBSTORE_FOOTER]);
diff --git a/ui/webui/resources/js/util.js b/ui/webui/resources/js/util.js
index d282081..37bc2bf 100644
--- a/ui/webui/resources/js/util.js
+++ b/ui/webui/resources/js/util.js
@@ -214,6 +214,8 @@ function queryRequiredElement(selectors, opt_context) {
// call into the browser to do the navigation.
['click', 'auxclick'].forEach(function(eventName) {
document.addEventListener(eventName, function(e) {
+ if (e.button > 1)
+ return; // Ignore buttons other than left and middle.
if (e.defaultPrevented)
return;