Index: chrome/renderer/user_script_slave.cc |
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc |
index 9db7e681e358883a66bb88231b6d41d58d842ae9..083ea7fd9e0deffa4a63f00ced12283b63c7c6b0 100644 |
--- a/chrome/renderer/user_script_slave.cc |
+++ b/chrome/renderer/user_script_slave.cc |
@@ -87,10 +87,12 @@ bool UserScriptSlave::UpdateScripts(base::SharedMemoryHandle shared_memory) { |
return true; |
} |
-bool UserScriptSlave::InjectScripts(WebFrame* frame) { |
+bool UserScriptSlave::InjectScripts(WebFrame* frame, |
+ UserScript::RunLocation location) { |
for (std::vector<UserScript*>::iterator script = scripts_.begin(); |
script != scripts_.end(); ++script) { |
- if ((*script)->MatchesUrl(frame->GetURL())) { |
+ if ((*script)->MatchesUrl(frame->GetURL()) && |
+ (*script)->run_location() == location) { |
std::string inject(kUserScriptHead); |
inject.append(api_js_.as_string()); |
inject.append(script_contents_[*script].as_string()); |