Lipis Lipis - 8 months ago 54
Node.js Question

How can I force external links from browser-window to open in a default browser from Electron?

I'm using the BrowserWindow to display an app and I would like to force the external links to be opened in the default browser. Is that even possible or I have to approach this differently?


I came up with this, after checking the solution from the previous answer.

main.webContents.on('new-window', function(e, url) {

According to the electron spec, new-window is fired when external links are clicked.