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

Unified Diff: chrome/browser/resources/synthetic_middleclick.js

Issue 2018943003: Fix history page middle click action (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « chrome/browser/resources/ntp4/synthetic_middleclick.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/synthetic_middleclick.js
diff --git a/chrome/browser/resources/ntp4/synthetic_middleclick.js b/chrome/browser/resources/synthetic_middleclick.js
similarity index 70%
rename from chrome/browser/resources/ntp4/synthetic_middleclick.js
rename to chrome/browser/resources/synthetic_middleclick.js
index 8c90c98a7f5abab97c059ede25c5e2a1345170b4..2045d3facf5c659f45e72efaad4768adfb51e65c 100644
--- a/chrome/browser/resources/ntp4/synthetic_middleclick.js
+++ b/chrome/browser/resources/synthetic_middleclick.js
@@ -21,4 +21,12 @@ document.addEventListener('mouseup', function(e) {
middleButtonMouseDownTarget = null;
}, true);
+// Prevent the synthetic click to open a new tab as the new tab will
+// open if the click happened on a link regardless of this synthetic
+// event.
Dan Beam 2016/05/31 21:34:32 i don't understand what this comment means. can y
Navid Zolghadr 2016/06/01 18:46:16 How about this?
+window.addEventListener('click', function(e) {
+ if (e.button == 1 && !e.isTrusted)
Dan Beam 2016/05/31 21:34:32 don't we control the code that's doing this? why
Navid Zolghadr 2016/06/01 18:46:16 Maybe the new comment explains this a little bette
+ e.preventDefault();
+});
+
})();
« no previous file with comments | « chrome/browser/resources/ntp4/synthetic_middleclick.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698