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
1 changed files with 3 additions and 1 deletions

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);
}
});
}
});