| 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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 if (options.useContentScriptContext) | 955 if (options.useContentScriptContext) |
| 956 contextSecurityOrigin = securityOrigin; | 956 contextSecurityOrigin = securityOrigin; |
| 957 else if (options.scriptExecutionContext) | 957 else if (options.scriptExecutionContext) |
| 958 contextSecurityOrigin = options.scriptExecutionContext; | 958 contextSecurityOrigin = options.scriptExecutionContext; |
| 959 | 959 |
| 960 var context; | 960 var context; |
| 961 var executionContexts = WebInspector.runtimeModel.executionContexts(
); | 961 var executionContexts = WebInspector.runtimeModel.executionContexts(
); |
| 962 if (contextSecurityOrigin) { | 962 if (contextSecurityOrigin) { |
| 963 for (var i = 0; i < executionContexts.length; ++i) { | 963 for (var i = 0; i < executionContexts.length; ++i) { |
| 964 var executionContext = executionContexts[i]; | 964 var executionContext = executionContexts[i]; |
| 965 if (executionContext.frameId === frame.id && executionContex
t.name === contextSecurityOrigin && !executionContext.isMainWorldContext) | 965 if (executionContext.frameId === frame.id && executionContex
t.origin === contextSecurityOrigin && !executionContext.isMainWorldContext) |
| 966 context = executionContext; | 966 context = executionContext; |
| 967 | 967 |
| 968 } | 968 } |
| 969 if (!context) { | 969 if (!context) { |
| 970 console.warn("The JavaScript context " + contextSecurityOrig
in + " was not found in the frame " + frame.url) | 970 console.warn("The JavaScript context " + contextSecurityOrig
in + " was not found in the frame " + frame.url) |
| 971 return this._status.E_NOTFOUND(contextSecurityOrigin) | 971 return this._status.E_NOTFOUND(contextSecurityOrigin) |
| 972 } | 972 } |
| 973 } else { | 973 } else { |
| 974 for (var i = 0; i < executionContexts.length; ++i) { | 974 for (var i = 0; i < executionContexts.length; ++i) { |
| 975 var executionContext = executionContexts[i]; | 975 var executionContext = executionContexts[i]; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 this.E_FAILED = makeStatus.bind(null, "E_FAILED", "Operation failed: %s"); | 1058 this.E_FAILED = makeStatus.bind(null, "E_FAILED", "Operation failed: %s"); |
| 1059 } | 1059 } |
| 1060 | 1060 |
| 1061 /** | 1061 /** |
| 1062 * @typedef {{code: string, description: string, details: !Array.<*>}} | 1062 * @typedef {{code: string, description: string, details: !Array.<*>}} |
| 1063 */ | 1063 */ |
| 1064 WebInspector.ExtensionStatus.Record; | 1064 WebInspector.ExtensionStatus.Record; |
| 1065 | 1065 |
| 1066 WebInspector.extensionAPI = {}; | 1066 WebInspector.extensionAPI = {}; |
| 1067 defineCommonExtensionSymbols(WebInspector.extensionAPI); | 1067 defineCommonExtensionSymbols(WebInspector.extensionAPI); |
| OLD | NEW |