| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 allHeaders[name] = headers[name]; | 221 allHeaders[name] = headers[name]; |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 NetworkAgent.setExtraHTTPHeaders(allHeaders); | 224 NetworkAgent.setExtraHTTPHeaders(allHeaders); |
| 225 }, | 225 }, |
| 226 | 226 |
| 227 _onApplyStyleSheet: function(message) | 227 _onApplyStyleSheet: function(message) |
| 228 { | 228 { |
| 229 if (!Runtime.experiments.isEnabled("applyCustomStylesheet")) | 229 if (!Runtime.experiments.isEnabled("applyCustomStylesheet")) |
| 230 return; | 230 return; |
| 231 var styleSheet = document.createElement("style"); | 231 var styleSheet = createElement("style"); |
| 232 styleSheet.textContent = message.styleSheet; | 232 styleSheet.textContent = message.styleSheet; |
| 233 document.head.appendChild(styleSheet); | 233 document.head.appendChild(styleSheet); |
| 234 }, | 234 }, |
| 235 | 235 |
| 236 _onCreatePanel: function(message, port) | 236 _onCreatePanel: function(message, port) |
| 237 { | 237 { |
| 238 var id = message.id; | 238 var id = message.id; |
| 239 // The ids are generated on the client API side and must be unique, so t
he check below | 239 // The ids are generated on the client API side and must be unique, so t
he check below |
| 240 // shouldn't be hit unless someone is bypassing the API. | 240 // shouldn't be hit unless someone is bypassing the API. |
| 241 if (id in this._clientObjects || WebInspector.inspectorView.hasPanel(id)
) | 241 if (id in this._clientObjects || WebInspector.inspectorView.hasPanel(id)
) |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 if (!originMatch) { | 798 if (!originMatch) { |
| 799 console.error("Skipping extension with invalid URL: " + startPag
e); | 799 console.error("Skipping extension with invalid URL: " + startPag
e); |
| 800 return false; | 800 return false; |
| 801 } | 801 } |
| 802 var extensionOrigin = originMatch[1]; | 802 var extensionOrigin = originMatch[1]; |
| 803 if (!this._registeredExtensions[extensionOrigin]) { | 803 if (!this._registeredExtensions[extensionOrigin]) { |
| 804 // See ExtensionAPI.js for details. | 804 // See ExtensionAPI.js for details. |
| 805 InspectorFrontendHost.setInjectedScriptForOrigin(extensionOrigin
, buildExtensionAPIInjectedScript(extensionInfo)); | 805 InspectorFrontendHost.setInjectedScriptForOrigin(extensionOrigin
, buildExtensionAPIInjectedScript(extensionInfo)); |
| 806 this._registeredExtensions[extensionOrigin] = { name: name }; | 806 this._registeredExtensions[extensionOrigin] = { name: name }; |
| 807 } | 807 } |
| 808 var iframe = document.createElement("iframe"); | 808 var iframe = createElement("iframe"); |
| 809 iframe.src = startPage; | 809 iframe.src = startPage; |
| 810 iframe.style.display = "none"; | 810 iframe.style.display = "none"; |
| 811 document.body.appendChild(iframe); | 811 document.body.appendChild(iframe); |
| 812 } catch (e) { | 812 } catch (e) { |
| 813 console.error("Failed to initialize extension " + startPage + ":" +
e); | 813 console.error("Failed to initialize extension " + startPage + ":" +
e); |
| 814 return false; | 814 return false; |
| 815 } | 815 } |
| 816 return true; | 816 return true; |
| 817 }, | 817 }, |
| 818 | 818 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 this.E_FAILED = makeStatus.bind(null, "E_FAILED", "Operation failed: %s"); | 1083 this.E_FAILED = makeStatus.bind(null, "E_FAILED", "Operation failed: %s"); |
| 1084 } | 1084 } |
| 1085 | 1085 |
| 1086 /** | 1086 /** |
| 1087 * @typedef {{code: string, description: string, details: !Array.<*>}} | 1087 * @typedef {{code: string, description: string, details: !Array.<*>}} |
| 1088 */ | 1088 */ |
| 1089 WebInspector.ExtensionStatus.Record; | 1089 WebInspector.ExtensionStatus.Record; |
| 1090 | 1090 |
| 1091 WebInspector.extensionAPI = {}; | 1091 WebInspector.extensionAPI = {}; |
| 1092 defineCommonExtensionSymbols(WebInspector.extensionAPI); | 1092 defineCommonExtensionSymbols(WebInspector.extensionAPI); |
| OLD | NEW |