Security: only open external links that start with https://

This commit is contained in:
Alice Gaudon 2020-04-01 09:24:44 +02:00
parent 40e2235bbe
commit da0c444215

View File

@ -77,7 +77,9 @@ function createWindow() {
console.log('Setting external links to open in default OS browser');
contents.on('new-window', (e, url) => {
e.preventDefault();
shell.openExternal(url);
if (url.startsWith('https://')) {
shell.openExternal(url);
}
});
}
});