From: Cheng Zhao Date: Mon, 6 Jul 2015 08:21:08 +0000 (+0800) Subject: Inherit current window's node-integration in window.open by default X-Git-Tag: v0.29.2~9 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ae3b47aa7506c73f57240edd9c1321f3601512ec;p=electron.git Inherit current window's node-integration in window.open by default Fix #2100. --- diff --git a/atom/renderer/lib/override.coffee b/atom/renderer/lib/override.coffee index 7c32727c..f87c6603 100644 --- a/atom/renderer/lib/override.coffee +++ b/atom/renderer/lib/override.coffee @@ -51,6 +51,12 @@ window.open = (url, frameName='', features='') -> (options[name] = parseInt(options[name], 10) if options[name]?) for name in ints + # Inherit the node-integration option of current window. + unless options['node-integration'] + for arg in process.argv when arg.indexOf('--node-integration=') is 0 + options['node-integration'] = arg.substr(-4) is 'true' + break + guestId = ipc.sendSync 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', url, frameName, options if guestId new BrowserWindowProxy(guestId)