From 902c16b08057904328f06081b28ed7e0cdc1be04 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Sun, 17 Apr 2016 22:11:01 +0900 Subject: [PATCH] Disable nodeIntegration on window.open() --- src/browser/index.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/browser/index.jsx b/src/browser/index.jsx index 9d4408d9..a60d518f 100644 --- a/src/browser/index.jsx +++ b/src/browser/index.jsx @@ -25,6 +25,16 @@ const settings = require('../common/settings'); remote.getCurrentWindow().removeAllListeners('focus'); +// New window should disable nodeIntergration. +const originalWindowOpen = window.open; +window.open = function(url, name, features) { + var f = 'nodeIntegration=no'; + if (features !== null) { + f += ',' + features; + } + originalWindowOpen(url, name, f); +}; + var MainPage = React.createClass({ getInitialState: function() { return {