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

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: Created 6 years, 9 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..040b4be583770f55d31051613d835359f6a74a95 100644
--- a/chrome/renderer/extensions/user_script_scheduler.cc
+++ b/chrome/renderer/extensions/user_script_scheduler.cc
@@ -185,7 +185,12 @@ 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 &&
+
+ bool is_webview_src_matched =
+ child_frame->document().url().string().equals(
+ WebString::fromUTF8(params.webview_src));
+ if ((!params.is_web_view ||
+ (params.is_web_view && !is_webview_src_matched)) &&
!PermissionsData::CanExecuteScriptOnPage(
extension,
child_frame->document().url(),

Powered by Google App Engine
This is Rietveld 408576698