Skip to content
This repository was archived by the owner on Sep 28, 2020. It is now read-only.

Commit c051173

Browse files
committed
open external links in default browser, ex. profile
1 parent 9ff5ba2 commit c051173

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

public/electron.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ function createWindow () {
4444
})
4545
}
4646

47+
mainWindow.webContents.on('new-window', function (e, url) {
48+
e.preventDefault()
49+
electron.shell.openExternal(url)
50+
})
51+
4752
electron.globalShortcut.register('f5', () => mainWindow.reload())
4853
electron.globalShortcut.register('CommandOrControl+R', () => mainWindow.reload())
4954
electron.globalShortcut.register('Alt+Left', () => {

0 commit comments

Comments
 (0)