Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /* eslint-disable indent */ | 5 /* eslint-disable indent */ |
| 6 (function(window) { | 6 (function(window) { |
| 7 | 7 |
| 8 // DevToolsAPI ---------------------------------------------------------------- | 8 // DevToolsAPI ---------------------------------------------------------------- |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1081 * @suppressGlobalPropertiesCheck | 1081 * @suppressGlobalPropertiesCheck |
| 1082 * @suppress {checkTypes} | 1082 * @suppress {checkTypes} |
| 1083 */ | 1083 */ |
| 1084 function installBackwardsCompatibility() | 1084 function installBackwardsCompatibility() |
| 1085 { | 1085 { |
| 1086 sanitizeRemoteFrontendUrl(); | 1086 sanitizeRemoteFrontendUrl(); |
| 1087 | 1087 |
| 1088 if (window.location.search.indexOf("remoteFrontend") === -1) | 1088 if (window.location.search.indexOf("remoteFrontend") === -1) |
| 1089 return; | 1089 return; |
| 1090 | 1090 |
| 1091 // Support for legacy (<M54) frontends. | |
| 1092 if (window.hasOwnProperty("onauxclick") && !window["InspectorFrontendAPI"].h asOwnProperty("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
| |
| 1093 document.addEventListener("auxclick", function(e) { | |
| 1094 let target = e.target; | |
| 1095 if (target.shadowRoot) | |
| 1096 target = target.shadowRoot.activeElement; | |
| 1097 if (e.button !== 0) { | |
| 1098 target.dispatchEvent(new MouseEvent("click", e)); | |
| 1099 if (e.detail === 2) | |
| 1100 target.dispatchEvent(new MouseEvent("dblclick", e)); | |
| 1101 } | |
| 1102 }, true); | |
| 1103 } | |
| 1104 | |
| 1091 // Support for legacy (<M53) frontends. | 1105 // Support for legacy (<M53) frontends. |
| 1092 if (!window.KeyboardEvent.prototype.hasOwnProperty("keyIdentifier")) { | 1106 if (!window.KeyboardEvent.prototype.hasOwnProperty("keyIdentifier")) { |
| 1093 Object.defineProperty(window.KeyboardEvent.prototype, "keyIdentifier", { | 1107 Object.defineProperty(window.KeyboardEvent.prototype, "keyIdentifier", { |
| 1094 get: function() | 1108 get: function() |
| 1095 { | 1109 { |
| 1096 return keyCodeToKeyIdentifier(this.keyCode); | 1110 return keyCodeToKeyIdentifier(this.keyCode); |
| 1097 } | 1111 } |
| 1098 }); | 1112 }); |
| 1099 } | 1113 } |
| 1100 | 1114 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1169 | 1183 |
| 1170 if (!DOMTokenList.prototype.__originalDOMTokenListToggle) { | 1184 if (!DOMTokenList.prototype.__originalDOMTokenListToggle) { |
| 1171 DOMTokenList.prototype.__originalDOMTokenListToggle = DOMTokenList.prototype .toggle; | 1185 DOMTokenList.prototype.__originalDOMTokenListToggle = DOMTokenList.prototype .toggle; |
| 1172 DOMTokenList.prototype.toggle = function(token, force) | 1186 DOMTokenList.prototype.toggle = function(token, force) |
| 1173 { | 1187 { |
| 1174 if (arguments.length === 1) | 1188 if (arguments.length === 1) |
| 1175 force = !this.contains(token); | 1189 force = !this.contains(token); |
| 1176 return this.__originalDOMTokenListToggle(token, !!force); | 1190 return this.__originalDOMTokenListToggle(token, !!force); |
| 1177 } | 1191 } |
| 1178 } | 1192 } |
| OLD | NEW |