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

Unified Diff: chrome/browser/extensions/api/execute_code_function.cc

Issue 226663003: Allow content script insertion on about:-URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use matches_about_blank key instead of about:* permission. Created 6 years, 8 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
Index: chrome/browser/extensions/api/execute_code_function.cc
diff --git a/chrome/browser/extensions/api/execute_code_function.cc b/chrome/browser/extensions/api/execute_code_function.cc
index 9a7ec7d75cb8a83b66a414b1fc801352fd0c3b0d..f9632003025966717f7fe8825ec443ccb35d832c 100644
--- a/chrome/browser/extensions/api/execute_code_function.cc
+++ b/chrome/browser/extensions/api/execute_code_function.cc
@@ -124,6 +124,9 @@ bool ExecuteCodeFunction::Execute(const std::string& code_string) {
ScriptExecutor::ALL_FRAMES :
ScriptExecutor::TOP_FRAME;
+ bool match_about_blank =
+ details_->matches_about_blank.get() && *details_->matches_about_blank;
+
UserScript::RunLocation run_at =
UserScript::UNDEFINED;
switch (details_->run_at) {
@@ -145,6 +148,7 @@ bool ExecuteCodeFunction::Execute(const std::string& code_string) {
script_type,
code_string,
frame_scope,
+ match_about_blank,
run_at,
ScriptExecutor::ISOLATED_WORLD,
IsWebView() ? ScriptExecutor::WEB_VIEW_PROCESS

Powered by Google App Engine
This is Rietveld 408576698