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

Unified Diff: extensions/renderer/user_script_scheduler.cc

Issue 226663003: Allow content script insertion on about:-URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move GetEffectiveDocumentURL to ScriptContext Created 6 years, 7 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 | « extensions/renderer/script_context_browsertest.cc ('k') | extensions/renderer/user_script_slave.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/user_script_scheduler.cc
diff --git a/extensions/renderer/user_script_scheduler.cc b/extensions/renderer/user_script_scheduler.cc
index 9c82fb7aaa411659c77c9857e0aaccb3369c75ea..92918d028095f93a1587f02f106a18884b8839b8 100644
--- a/extensions/renderer/user_script_scheduler.cc
+++ b/extensions/renderer/user_script_scheduler.cc
@@ -188,23 +188,23 @@ void UserScriptScheduler::ExecuteCodeImpl(
// For child frames, we just skip ones the extension doesn't have access
// to and carry on.
+ GURL document_url = ScriptContext::GetEffectiveDocumentURL(
+ child_frame, child_frame->document().url(), params.match_about_blank);
bool can_execute_script =
PermissionsData::CanExecuteScriptOnPage(extension,
- child_frame->document().url(),
+ document_url,
top_url,
extension_helper->tab_id(),
NULL,
-1,
NULL);
if ((!params.is_web_view && !can_execute_script) ||
- (params.is_web_view &&
- child_frame->document().url() != params.webview_src)) {
+ (params.is_web_view && document_url != params.webview_src)) {
if (child_frame->parent()) {
continue;
} else {
error = ErrorUtils::FormatErrorMessage(
- manifest_errors::kCannotAccessPage,
- child_frame->document().url().spec());
+ manifest_errors::kCannotAccessPage, document_url.spec());
break;
}
}
« no previous file with comments | « extensions/renderer/script_context_browsertest.cc ('k') | extensions/renderer/user_script_slave.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698