Fix electron window.open vulnerability (#3457)

* Fix electron window.open vulnerability

* Comment to remove fix when merged into Hyper3
This commit is contained in:
CHaBou 2019-02-05 05:39:36 +01:00 committed by Juan Campa
parent 1a82866fec
commit 17fcae570b

View file

@ -226,6 +226,10 @@ module.exports = class Window {
}
});
// mitigate a security issue: https://electronjs.org/blog/window-open-fix
// TODO: remove when merged into Hyper 3 (already has the fix via electron)
window.webContents.on('-add-new-contents', e => e.preventDefault());
// expose internals to extension authors
window.rpc = rpc;
window.sessions = sessions;