diff options
Diffstat (limited to 'chrome/renderer/render_view.cc')
-rw-r--r-- | chrome/renderer/render_view.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index bbe14c4..a8adb2f 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -1454,15 +1454,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 during unit tests. + g_render_thread->user_script_slave()->InjectScripts( + frame, UserScript::DOCUMENT_END); } void RenderView::DidHandleOnloadEventsForFrame(WebView* webview, @@ -1530,6 +1524,12 @@ void RenderView::WindowObjectCleared(WebFrame* webframe) { #endif } +void RenderView::DocumentElementAvailable(WebFrame* frame) { + if (g_render_thread) // Will be NULL during unit tests. + g_render_thread->user_script_slave()->InjectScripts( + frame, UserScript::DOCUMENT_START); +} + WindowOpenDisposition RenderView::DispositionForNavigationAction( WebView* webview, WebFrame* frame, |