import open from 'open';
...
...
...
app.on('web-contents-created', (_event, contents) => {
contents.on('new-window', (e, urlLink) => {
e.preventDefault();
open(urlLink);
});
contents.on('will-navigate', (e, urlLink) => {
if (urlLink !== contents.getURL()) {
e.preventDefault();
open(urlLink);
}
});
});