Index: chrome/browser/extensions/user_script_master.cc |
diff --git a/chrome/browser/extensions/user_script_master.cc b/chrome/browser/extensions/user_script_master.cc |
index 024de802c38cd67ce980a428dabefa88477a1094..2da2d8f8952dfaa3738870116cee0804d21f37de 100644 |
--- a/chrome/browser/extensions/user_script_master.cc |
+++ b/chrome/browser/extensions/user_script_master.cc |
@@ -166,6 +166,11 @@ void UserScriptMaster::ScriptReloader::LoadScriptsFromDirectory( |
file = enumerator.Next()) { |
result->push_back(UserScript()); |
UserScript& user_script = result->back(); |
+ |
+ // We default standalone user scripts to document-end for better |
+ // Greasemonkey compatibility. |
+ user_script.set_run_location(UserScript::DOCUMENT_END); |
+ |
// Push single js file in this UserScript. |
GURL url(std::string(chrome::kUserScriptScheme) + ":/" + |
net::FilePathToFileURL(file).ExtractFileName()); |