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

Unified Diff: chrome/browser/extensions/user_script_master.cc

Issue 339064: Add new user script injection point: document_idle. (Closed)
Patch Set: smaller, cleaner, better Created 11 years, 2 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
« no previous file with comments | « no previous file | chrome/chrome.gyp » ('j') | chrome/renderer/navigation_state.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | chrome/chrome.gyp » ('j') | chrome/renderer/navigation_state.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698