It is not allowed to run scripts in DidCreateDocumentElement

This commit is contained in:
Cheng Zhao 2016-05-10 15:43:25 +09:00
parent 906ae043f9
commit bb5b30b8a0
3 changed files with 9 additions and 4 deletions

View file

@ -33,6 +33,7 @@
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPluginParams.h"
#include "third_party/WebKit/public/web/WebKit.h"
#include "third_party/WebKit/public/web/WebScriptSource.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "third_party/WebKit/public/web/WebView.h"
@ -160,6 +161,13 @@ void AtomRendererClient::RenderViewCreated(content::RenderView* render_view) {
}
}
void AtomRendererClient::RunScriptsAtDocumentStart(
content::RenderFrame* render_frame) {
// Make sure every page will get a script context created.
render_frame->GetWebFrame()->executeScript(
blink::WebScriptSource("void 0"));
}
blink::WebSpeechSynthesizer* AtomRendererClient::OverrideSpeechSynthesizer(
blink::WebSpeechSynthesizerClient* client) {
return new TtsDispatcher(client);