diff --git a/atom.gyp b/atom.gyp index 37df94de212..01993ad8f15 100644 --- a/atom.gyp +++ b/atom.gyp @@ -181,6 +181,8 @@ 'atom/browser/ui/x/x_window_utils.h', 'atom/browser/web_view/web_view_manager.cc', 'atom/browser/web_view/web_view_manager.h', + 'atom/browser/web_view/web_view_renderer_state.cc', + 'atom/browser/web_view/web_view_renderer_state.h', 'atom/browser/window_list.cc', 'atom/browser/window_list.h', 'atom/browser/window_list_observer.h', diff --git a/atom/browser/atom_browser_client.cc b/atom/browser/atom_browser_client.cc index 3b99903f35a..7045a09924a 100644 --- a/atom/browser/atom_browser_client.cc +++ b/atom/browser/atom_browser_client.cc @@ -9,13 +9,14 @@ #include "atom/browser/atom_browser_main_parts.h" #include "atom/browser/atom_speech_recognition_manager_delegate.h" #include "atom/browser/native_window.h" +#include "atom/browser/web_view/web_view_renderer_state.h" #include "atom/browser/window_list.h" +#include "atom/common/options_switches.h" #include "base/command_line.h" #include "chrome/browser/printing/printing_message_filter.h" #include "chrome/browser/speech/tts_message_filter.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" -#include "content/public/browser/resource_dispatcher_host.h" #include "content/public/browser/site_instance.h" #include "content/public/browser/web_contents.h" #include "content/public/common/web_preferences.h" @@ -140,11 +141,17 @@ void AtomBrowserClient::AppendExtraCommandLineSwitches( window = *iter; } - if (window != NULL) + if (window != NULL) { window->AppendExtraCommandLineSwitches(command_line, child_process_id); - else - // If we can not find a owner window then it is a guest web view. - command_line->AppendSwitch("guest"); + } else { + // Append commnad line arguments for guest web view. + WebViewRendererState::WebViewInfo info; + if (WebViewRendererState::GetInstance()->GetInfo(child_process_id, &info)) { + command_line->AppendSwitch("guest"); + command_line->AppendSwitchASCII(switches::kNodeIntegration, + info.node_integration ? "true" : "false"); + } + } dying_render_process_ = NULL; } diff --git a/atom/browser/default_app/default_app.js b/atom/browser/default_app/default_app.js index 14ca8719c55..269821d2a3d 100644 --- a/atom/browser/default_app/default_app.js +++ b/atom/browser/default_app/default_app.js @@ -16,7 +16,6 @@ app.on('ready', function() { width: 800, height: 600, resizable: false, - 'node-integration': true, 'auto-hide-menu-bar': true, 'use-content-size': true, 'web-preferences': { diff --git a/atom/browser/default_app/index.html b/atom/browser/default_app/index.html index db06acafc15..83b5122782f 100644 --- a/atom/browser/default_app/index.html +++ b/atom/browser/default_app/index.html @@ -56,8 +56,6 @@ - -