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 /* eslint-disable indent */ | 4 /* eslint-disable indent */ |
5 (function(window) { | 5 (function(window) { |
6 | 6 |
7 // DevToolsAPI --------------------------------------------------------------- - | 7 // DevToolsAPI --------------------------------------------------------------- - |
8 | 8 |
9 /** | 9 /** |
10 * @unrestricted | 10 * @unrestricted |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 inspectorFrontendAPI[method].apply(inspectorFrontendAPI, args); | 57 inspectorFrontendAPI[method].apply(inspectorFrontendAPI, args); |
58 } | 58 } |
59 | 59 |
60 // API methods below this line -------------------------------------------- | 60 // API methods below this line -------------------------------------------- |
61 | 61 |
62 /** | 62 /** |
63 * @param {!Array.<!ExtensionDescriptor>} extensions | 63 * @param {!Array.<!ExtensionDescriptor>} extensions |
64 */ | 64 */ |
65 addExtensions(extensions) { | 65 addExtensions(extensions) { |
66 // Support for legacy front-ends (<M41). | 66 // Support for legacy front-ends (<M41). |
67 if (window['WebInspector'] && window['WebInspector']['addExtensions']) | 67 if (window['WebInspector'] && window['WebInspector']['addExtensions']) { |
68 window['WebInspector']['addExtensions'](extensions); | 68 window['WebInspector']['addExtensions'](extensions); |
69 else | 69 } else if (window['InspectorFrontendAPI']) { |
70 // The addExtensions command is sent as the onload event happens for | |
71 // DevTools front-end. In case of DEBUG_DEVTOOLS/hosted mode, this | |
dgozman
2017/03/09 23:35:17
That's only in hosted mode.
lushnikov
2017/03/10 02:27:58
Done.
| |
72 // happens before the InspectorFrontendAPI is initialized. | |
70 this._dispatchOnInspectorFrontendAPI('addExtensions', [extensions]); | 73 this._dispatchOnInspectorFrontendAPI('addExtensions', [extensions]); |
74 } | |
71 } | 75 } |
72 | 76 |
73 /** | 77 /** |
74 * @param {string} url | 78 * @param {string} url |
75 */ | 79 */ |
76 appendedToURL(url) { | 80 appendedToURL(url) { |
77 this._dispatchOnInspectorFrontendAPI('appendedToURL', [url]); | 81 this._dispatchOnInspectorFrontendAPI('appendedToURL', [url]); |
78 } | 82 } |
79 | 83 |
80 /** | 84 /** |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1254 * @return {boolean} | 1258 * @return {boolean} |
1255 */ | 1259 */ |
1256 DOMTokenList.prototype.toggle = function(token, force) { | 1260 DOMTokenList.prototype.toggle = function(token, force) { |
1257 if (arguments.length === 1) | 1261 if (arguments.length === 1) |
1258 force = !this.contains(token); | 1262 force = !this.contains(token); |
1259 return this.__originalDOMTokenListToggle(token, !!force); | 1263 return this.__originalDOMTokenListToggle(token, !!force); |
1260 }; | 1264 }; |
1261 } | 1265 } |
1262 | 1266 |
1263 })(window); | 1267 })(window); |
OLD | NEW |