summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/user_script_slave.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/user_script_slave.cc')
-rw-r--r--chrome/renderer/user_script_slave.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc
index 4820c83..68dec43 100644
--- a/chrome/renderer/user_script_slave.cc
+++ b/chrome/renderer/user_script_slave.cc
@@ -163,6 +163,10 @@ bool UserScriptSlave::InjectScripts(WebFrame* frame,
for (size_t i = 0; i < scripts_.size(); ++i) {
std::vector<WebScriptSource> sources;
UserScript* script = scripts_[i];
+
+ if (frame->parent() && !script->match_all_frames())
+ continue; // Only match subframes if the script declared it wanted to.
+
if (!script->MatchesUrl(frame->url()))
continue; // This frame doesn't match the script url pattern, skip it.