Index: chrome/renderer/user_script_slave.cc |
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc |
index fa4eb7dfa551b17ac2da97721ce41b0a010bf3c4..647cdc49a80bdb8271f6007a639a476807edb5ba 100644 |
--- a/chrome/renderer/user_script_slave.cc |
+++ b/chrome/renderer/user_script_slave.cc |
@@ -33,13 +33,8 @@ UserScriptSlave::UserScriptSlave() |
: shared_memory_(NULL), |
script_deleter_(&scripts_), |
user_script_start_line_(0) { |
- // TODO: Only windows supports resources and only windows supports user |
- // scrips, so only load the Greasemonkey API on windows. Fix this when |
- // better cross platofrm support is available. |
-#if defined(OS_WIN) |
api_js_ = ResourceBundle::GetSharedInstance().GetRawDataResource( |
IDR_GREASEMONKEY_API_JS); |
-#endif |
// Count the number of lines that will be injected before the user script. |
StringPiece::size_type pos = 0; |
@@ -111,6 +106,10 @@ bool UserScriptSlave::UpdateScripts(base::SharedMemoryHandle shared_memory) { |
bool UserScriptSlave::InjectScripts(WebFrame* frame, |
UserScript::RunLocation location) { |
+ // Don't bother if this is not a URL we inject script into. |
+ if (!URLPattern::IsValidScheme(frame->GetURL().scheme())) |
+ return true; |
+ |
PerfTimer timer; |
int num_matched = 0; |