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

Unified Diff: chrome/renderer/user_script_slave.cc

Issue 149619: Various minor extension fixes (Closed)
Patch Set: One more test Created 11 years, 5 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/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;

Powered by Google App Engine
This is Rietveld 408576698