Skip to content

Commit 0a1c1b9

Browse files
committed
Open link with default browser
1 parent 2217888 commit 0a1c1b9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

app/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {app, BrowserWindow, Menu} = require('electron')
1+
const { app, BrowserWindow, Menu, shell } = require('electron')
22
const path = require('path')
33
const url = require('url')
44

@@ -19,6 +19,11 @@ function createWindow () {
1919
slashes: true
2020
}))
2121

22+
win.webContents.on('new-window', (e, url) => {
23+
e.preventDefault()
24+
shell.openExternal(url)
25+
})
26+
2227
const template = [
2328
{
2429
label: 'Application',

0 commit comments

Comments
 (0)