| 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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 | 759 |
| 760 try { | 760 try { |
| 761 var originMatch = urlOriginRegExp.exec(startPage); | 761 var originMatch = urlOriginRegExp.exec(startPage); |
| 762 if (!originMatch) { | 762 if (!originMatch) { |
| 763 console.error("Skipping extension with invalid URL: " + startPag
e); | 763 console.error("Skipping extension with invalid URL: " + startPag
e); |
| 764 return false; | 764 return false; |
| 765 } | 765 } |
| 766 var extensionOrigin = originMatch[1]; | 766 var extensionOrigin = originMatch[1]; |
| 767 if (!this._registeredExtensions[extensionOrigin]) { | 767 if (!this._registeredExtensions[extensionOrigin]) { |
| 768 // See ExtensionAPI.js for details. | 768 // See ExtensionAPI.js for details. |
| 769 InspectorFrontendHost.setInjectedScriptForOrigin(extensionOrigin
, buildExtensionAPIInjectedScript(extensionInfo, this._inspectedTabId)); | 769 InspectorFrontendHost.setInjectedScriptForOrigin(extensionOrigin
, buildExtensionAPIInjectedScript(extensionInfo, this._inspectedTabId, WebInspec
tor.themeSupport.themeName())); |
| 770 this._registeredExtensions[extensionOrigin] = { name: name }; | 770 this._registeredExtensions[extensionOrigin] = { name: name }; |
| 771 } | 771 } |
| 772 var iframe = createElement("iframe"); | 772 var iframe = createElement("iframe"); |
| 773 iframe.src = startPage; | 773 iframe.src = startPage; |
| 774 iframe.style.display = "none"; | 774 iframe.style.display = "none"; |
| 775 document.body.appendChild(iframe); // Only for main window. | 775 document.body.appendChild(iframe); // Only for main window. |
| 776 } catch (e) { | 776 } catch (e) { |
| 777 console.error("Failed to initialize extension " + startPage + ":" +
e); | 777 console.error("Failed to initialize extension " + startPage + ":" +
e); |
| 778 return false; | 778 return false; |
| 779 } | 779 } |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 /** | 1073 /** |
| 1074 * @typedef {{code: string, description: string, details: !Array.<*>}} | 1074 * @typedef {{code: string, description: string, details: !Array.<*>}} |
| 1075 */ | 1075 */ |
| 1076 WebInspector.ExtensionStatus.Record; | 1076 WebInspector.ExtensionStatus.Record; |
| 1077 | 1077 |
| 1078 WebInspector.extensionAPI = {}; | 1078 WebInspector.extensionAPI = {}; |
| 1079 defineCommonExtensionSymbols(WebInspector.extensionAPI); | 1079 defineCommonExtensionSymbols(WebInspector.extensionAPI); |
| 1080 | 1080 |
| 1081 /** @type {!WebInspector.ExtensionServer} */ | 1081 /** @type {!WebInspector.ExtensionServer} */ |
| 1082 WebInspector.extensionServer; | 1082 WebInspector.extensionServer; |
| OLD | NEW |