Index: chrome/renderer/render_view.cc |
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc |
index fdafb53db192173537874aa8bf375e1c33fa5e03..0a412de10db8cba50a87b20e7184efec6bbc653b 100644 |
--- a/chrome/renderer/render_view.cc |
+++ b/chrome/renderer/render_view.cc |
@@ -1459,15 +1459,9 @@ void RenderView::DidFinishDocumentLoadForFrame(WebView* webview, |
// Check whether we have new encoding name. |
UpdateEncoding(frame, webview->GetMainFrameEncodingName()); |
- // Inject any user scripts. Do not inject into chrome UI pages, but do inject |
- // into any other document. |
- const GURL &gurl = frame->GetURL(); |
- if (g_render_thread && // Will be NULL when testing. |
- (gurl.SchemeIs("file") || |
- gurl.SchemeIs("http") || |
- gurl.SchemeIs("https"))) { |
- g_render_thread->user_script_slave()->InjectScripts(frame); |
- } |
+ if (g_render_thread) // Will be NULL when testing. |
+ g_render_thread->user_script_slave()->InjectScripts( |
+ frame, UserScript::DOCUMENT_END); |
} |
void RenderView::DidHandleOnloadEventsForFrame(WebView* webview, |
@@ -1535,6 +1529,12 @@ void RenderView::WindowObjectCleared(WebFrame* webframe) { |
#endif |
} |
+void RenderView::DocumentElementAvailable(WebFrame* frame) { |
+ if (g_render_thread) // Will be NULL when testing. |
+ g_render_thread->user_script_slave()->InjectScripts( |
+ frame, UserScript::DOCUMENT_START); |
+} |
+ |
WindowOpenDisposition RenderView::DispositionForNavigationAction( |
WebView* webview, |
WebFrame* frame, |