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

Unified Diff: chrome/renderer/extensions/user_script_scheduler.cc

Issue 226043005: Fix webview.executeScript API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make use of GURL. 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/renderer/extensions/user_script_scheduler.cc
diff --git a/chrome/renderer/extensions/user_script_scheduler.cc b/chrome/renderer/extensions/user_script_scheduler.cc
index b4cf64f135fad41982506854958dd402fbe9169e..6f2dd032a548bb64461b745a1609f8a3233422aa 100644
--- a/chrome/renderer/extensions/user_script_scheduler.cc
+++ b/chrome/renderer/extensions/user_script_scheduler.cc
@@ -185,15 +185,18 @@ void UserScriptScheduler::ExecuteCodeImpl(
//
// For child frames, we just skip ones the extension doesn't have access
// to and carry on.
- if (!params.is_web_view &&
- !PermissionsData::CanExecuteScriptOnPage(
- extension,
- child_frame->document().url(),
- frame_->document().url(),
- extension_helper->tab_id(),
- NULL,
- -1,
- NULL)) {
+
+ bool can_execute_script =
+ PermissionsData::CanExecuteScriptOnPage(extension,
+ child_frame->document().url(),
+ frame_->document().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)) {
not at google - send to devlin 2014/04/07 21:00:07 much nicer, thanks!
Xi Han 2014/04/07 21:09:44 Done.
if (child_frame->parent()) {
continue;
} else {

Powered by Google App Engine
This is Rietveld 408576698