Lipis Lipis - 1 year ago 174
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download