| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 | 946 |
| 947 /** | 947 /** |
| 948 * @suppress {checkVars, checkTypes} | 948 * @suppress {checkVars, checkTypes} |
| 949 */ | 949 */ |
| 950 function platformExtensionAPI(coreAPI) | 950 function platformExtensionAPI(coreAPI) |
| 951 { | 951 { |
| 952 function getTabId() | 952 function getTabId() |
| 953 { | 953 { |
| 954 return tabId; | 954 return tabId; |
| 955 } | 955 } |
| 956 chrome = window.chrome || {}; | 956 var chrome = window.chrome || {}; |
| 957 // Override chrome.devtools as a workaround for a error-throwing getter bein
g exposed | 957 // Override chrome.devtools as a workaround for a error-throwing getter bein
g exposed |
| 958 // in extension pages loaded into a non-extension process (only happens for
remote client | 958 // in extension pages loaded into a non-extension process (only happens for
remote client |
| 959 // extensions) | 959 // extensions) |
| 960 var devtools_descriptor = Object.getOwnPropertyDescriptor(chrome, "devtools"
); | 960 var devtools_descriptor = Object.getOwnPropertyDescriptor(chrome, "devtools"
); |
| 961 if (!devtools_descriptor || devtools_descriptor.get) | 961 if (!devtools_descriptor || devtools_descriptor.get) |
| 962 Object.defineProperty(chrome, "devtools", { value: {}, enumerable: true
}); | 962 Object.defineProperty(chrome, "devtools", { value: {}, enumerable: true
}); |
| 963 // Only expose tabId on chrome.devtools.inspectedWindow, not webInspector.in
spectedWindow. | 963 // Only expose tabId on chrome.devtools.inspectedWindow, not webInspector.in
spectedWindow. |
| 964 chrome.devtools.inspectedWindow = {}; | 964 chrome.devtools.inspectedWindow = {}; |
| 965 chrome.devtools.inspectedWindow.__defineGetter__("tabId", getTabId); | 965 chrome.devtools.inspectedWindow.__defineGetter__("tabId", getTabId); |
| 966 chrome.devtools.inspectedWindow.__proto__ = coreAPI.inspectedWindow; | 966 chrome.devtools.inspectedWindow.__proto__ = coreAPI.inspectedWindow; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 { | 1004 { |
| 1005 return "(function(injectedScriptId){ " + | 1005 return "(function(injectedScriptId){ " + |
| 1006 "var extensionServer;" + | 1006 "var extensionServer;" + |
| 1007 defineCommonExtensionSymbols.toString() + ";" + | 1007 defineCommonExtensionSymbols.toString() + ";" + |
| 1008 injectedExtensionAPI.toString() + ";" + | 1008 injectedExtensionAPI.toString() + ";" + |
| 1009 buildPlatformExtensionAPI(extensionInfo, inspectedTabId) + ";" + | 1009 buildPlatformExtensionAPI(extensionInfo, inspectedTabId) + ";" + |
| 1010 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + | 1010 "platformExtensionAPI(injectedExtensionAPI(injectedScriptId));" + |
| 1011 "return {};" + | 1011 "return {};" + |
| 1012 "})"; | 1012 "})"; |
| 1013 } | 1013 } |
| OLD | NEW |