Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Unified Diff: extensions/renderer/extension_injection_host.cc

Issue 1288893005: [Script Injection] Allow whitelisted extensions to inject scripts everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing file Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/all_urls/bystander/page.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/extension_injection_host.cc
diff --git a/extensions/renderer/extension_injection_host.cc b/extensions/renderer/extension_injection_host.cc
index 16b0831b6e2f4bd72537678c6d324fd450ff0ced..ec75068ed1244a1eb31fbcb240ccedf80accbaac 100644
--- a/extensions/renderer/extension_injection_host.cc
+++ b/extensions/renderer/extension_injection_host.cc
@@ -57,8 +57,10 @@ PermissionsData::AccessType ExtensionInjectionHost::CanExecuteOnFrame(
blink::WebSecurityOrigin top_frame_security_origin =
render_frame->GetWebFrame()->top()->securityOrigin();
+ // Only whitelisted extensions may run scripts on another extension's page.
if (top_frame_security_origin.protocol().utf8() == kExtensionScheme &&
- top_frame_security_origin.host().utf8() != extension_->id())
+ top_frame_security_origin.host().utf8() != extension_->id() &&
+ !PermissionsData::CanExecuteScriptEverywhere(extension_))
return PermissionsData::ACCESS_DENIED;
// Declarative user scripts use "page access" (from "permissions" section in
« no previous file with comments | « chrome/test/data/extensions/api_test/all_urls/bystander/page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698