diff --git a/atom/renderer/atom_renderer_client.cc b/atom/renderer/atom_renderer_client.cc index 7ff87a582a26..a996bd0efb25 100644 --- a/atom/renderer/atom_renderer_client.cc +++ b/atom/renderer/atom_renderer_client.cc @@ -55,7 +55,7 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver { void DidCreateScriptContext(v8::Handle context, int extension_group, int world_id) override { - if (world_id_ != -1) + if (world_id_ != -1 && world_id_ != world_id) return; world_id_ = world_id; renderer_client_->DidCreateScriptContext(context); @@ -88,9 +88,6 @@ void AtomRendererClient::WebKitInitialized() { blink::WebCustomElement::addEmbedderCustomElementName("webview"); blink::WebCustomElement::addEmbedderCustomElementName("browserplugin"); - // Allow file scheme to handle service worker by default. - blink::WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers("file"); - OverrideNodeArrayBuffer(); node_bindings_->Initialize(); @@ -123,6 +120,9 @@ void AtomRendererClient::RenderFrameCreated( content::RenderFrame* render_frame) { new PepperHelper(render_frame); + // Allow file scheme to handle service worker by default. + blink::WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers("file"); + // Only insert node integration for the main frame. if (!render_frame->IsMainFrame()) return;