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

Unified Diff: third_party/WebKit/Source/devtools/front_end/devtools.js

Issue 2163893003: Start sending auxclick instead of click for non-primary buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding remote debugging auxclick polyfill Created 4 years, 4 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
Index: third_party/WebKit/Source/devtools/front_end/devtools.js
diff --git a/third_party/WebKit/Source/devtools/front_end/devtools.js b/third_party/WebKit/Source/devtools/front_end/devtools.js
index 5e83ae3bb1ca36b38dfeedb22024902029e551ba..c831db8b7fe72a590489c17ec406489d72a03736 100644
--- a/third_party/WebKit/Source/devtools/front_end/devtools.js
+++ b/third_party/WebKit/Source/devtools/front_end/devtools.js
@@ -1088,6 +1088,20 @@ function installBackwardsCompatibility()
if (window.location.search.indexOf("remoteFrontend") === -1)
return;
+ // Support for legacy (<M54) frontends.
+ if (window.hasOwnProperty("onauxclick") && !window["InspectorFrontendAPI"].hasOwnProperty("onauxclick")) {
dgozman 2016/08/03 20:54:28 This detection won't work: the hosting Chrome brow
Navid Zolghadr 2016/08/03 21:35:20 I tested this and this did cause my remote devtool
+ document.addEventListener("auxclick", function(e) {
+ let target = e.target;
+ if (target.shadowRoot)
+ target = target.shadowRoot.activeElement;
+ if (e.button !== 0) {
+ target.dispatchEvent(new MouseEvent("click", e));
+ if (e.detail === 2)
+ target.dispatchEvent(new MouseEvent("dblclick", e));
+ }
+ }, true);
+ }
+
// Support for legacy (<M53) frontends.
if (!window.KeyboardEvent.prototype.hasOwnProperty("keyIdentifier")) {
Object.defineProperty(window.KeyboardEvent.prototype, "keyIdentifier", {

Powered by Google App Engine
This is Rietveld 408576698