Disable nodeIntegration on window.open()

This commit is contained in:
Yuya Ochiai
2016-04-17 22:11:01 +09:00
parent 35e1787e2f
commit 902c16b080

View File

@@ -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 {