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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 | 771 |
772 try { | 772 try { |
773 var originMatch = urlOriginRegExp.exec(startPage); | 773 var originMatch = urlOriginRegExp.exec(startPage); |
774 if (!originMatch) { | 774 if (!originMatch) { |
775 console.error("Skipping extension with invalid URL: " + startPag
e); | 775 console.error("Skipping extension with invalid URL: " + startPag
e); |
776 return false; | 776 return false; |
777 } | 777 } |
778 var extensionOrigin = originMatch[1]; | 778 var extensionOrigin = originMatch[1]; |
779 if (!this._registeredExtensions[extensionOrigin]) { | 779 if (!this._registeredExtensions[extensionOrigin]) { |
780 // See ExtensionAPI.js for details. | 780 // See ExtensionAPI.js for details. |
781 InspectorFrontendHost.setInjectedScriptForOrigin(extensionOrigin
, buildExtensionAPIInjectedScript(extensionInfo, this._inspectedTabId, WebInspec
tor.themeSupport.themeName())); | 781 var injectedAPI = buildExtensionAPIInjectedScript(extensionInfo,
this._inspectedTabId, WebInspector.themeSupport.themeName(), WebInspector.exten
sionServer["_extensionAPITestHook"]); |
| 782 InspectorFrontendHost.setInjectedScriptForOrigin(extensionOrigin
, injectedAPI); |
782 this._registeredExtensions[extensionOrigin] = { name: name }; | 783 this._registeredExtensions[extensionOrigin] = { name: name }; |
783 } | 784 } |
784 var iframe = createElement("iframe"); | 785 var iframe = createElement("iframe"); |
785 iframe.src = startPage; | 786 iframe.src = startPage; |
786 iframe.style.display = "none"; | 787 iframe.style.display = "none"; |
787 document.body.appendChild(iframe); // Only for main window. | 788 document.body.appendChild(iframe); // Only for main window. |
788 } catch (e) { | 789 } catch (e) { |
789 console.error("Failed to initialize extension " + startPage + ":" +
e); | 790 console.error("Failed to initialize extension " + startPage + ":" +
e); |
790 return false; | 791 return false; |
791 } | 792 } |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 /** | 1093 /** |
1093 * @typedef {{code: string, description: string, details: !Array.<*>}} | 1094 * @typedef {{code: string, description: string, details: !Array.<*>}} |
1094 */ | 1095 */ |
1095 WebInspector.ExtensionStatus.Record; | 1096 WebInspector.ExtensionStatus.Record; |
1096 | 1097 |
1097 WebInspector.extensionAPI = {}; | 1098 WebInspector.extensionAPI = {}; |
1098 defineCommonExtensionSymbols(WebInspector.extensionAPI); | 1099 defineCommonExtensionSymbols(WebInspector.extensionAPI); |
1099 | 1100 |
1100 /** @type {!WebInspector.ExtensionServer} */ | 1101 /** @type {!WebInspector.ExtensionServer} */ |
1101 WebInspector.extensionServer; | 1102 WebInspector.extensionServer; |
OLD | NEW |