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

Side by Side Diff: chrome/browser/resources/ntp4/synthetic_middleclick.js

Issue 1963823002: Dispatch middle click manually by tracking mouse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Applying comments 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
Lei Zhang 2016/05/10 19:01:42 no (c)
Navid Zolghadr 2016/05/10 19:28:26 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
Lei Zhang 2016/05/10 19:01:42 add blank line after.
Navid Zolghadr 2016/05/10 19:28:26 Done.
4 var middleButtonMouseDownTarget = null;
5 document.addEventListener('mousedown', function(e) {
6 if (e.button == 1) {
7 middleButtonMouseDownTarget = e.target;
8 }
9 }, true);
10 document.addEventListener('mouseup', function(e) {
11 if (e.button == 1) {
12 if (e.target == middleButtonMouseDownTarget)
13 e.target.dispatchEvent(new MouseEvent('click', e));
14 middleButtonMouseDownTarget = null;
15 }
16 }, true);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698