Index: chrome/renderer/user_script_slave.cc |
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc |
index bdddbc31f1353ced8683ba482209f1539a21602f..bfd08c543ede57725da77660278fe8ce748acff7 100644 |
--- a/chrome/renderer/user_script_slave.cc |
+++ b/chrome/renderer/user_script_slave.cc |
@@ -141,6 +141,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. |