Chromium Code Reviews| Index: chrome/renderer/extensions/extension_dispatcher.cc |
| diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc |
| index 8226de81f55566ed5a7a4b22761903b17b629b15..c4bb06d8e4f610d23c504595fc33c03c3d87e136 100644 |
| --- a/chrome/renderer/extensions/extension_dispatcher.cc |
| +++ b/chrome/renderer/extensions/extension_dispatcher.cc |
| @@ -896,6 +896,16 @@ Feature::Context ExtensionDispatcher::ClassifyJavaScriptContext( |
| if (extension_group == EXTENSION_GROUP_CONTENT_SCRIPTS) |
| return Feature::CONTENT_SCRIPT_CONTEXT; |
| + // We have an explicit check for sandboxed pages first since: |
|
Mihai Parparita -not on Chrome
2012/06/05 22:21:57
I ended up having to add this, since API bindings
|
| + // 1. Sandboxed pages run in the same process as regular extension pages, so |
| + // the extension is considered active. |
| + // 2. ScriptContext creation (which triggers bindings injection) happens |
| + // before the SecurityContext is updated with the sandbox flags (after |
| + // reading the CSP header), so url_info.url().securityOrigin() is not |
| + // unique yet. |
| + if (extensions_.IsSandboxedPage(url_info)) |
| + return Feature::WEB_PAGE_CONTEXT; |
| + |
| if (IsExtensionActive(extension_id)) |
| return Feature::BLESSED_EXTENSION_CONTEXT; |