electron: allow openning links (in default browser)
This commit is contained in:
parent
a3c587168c
commit
3b2c2e07d4
2 changed files with 9 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
var path = require('path'),
|
||||
{BrowserWindow, dialog} = require('electron'),
|
||||
{BrowserWindow, dialog, shell} = require('electron'),
|
||||
shortcut = require('electron-localshortcut'),
|
||||
settings = require('./settings'),
|
||||
theme = require('./theme')
|
||||
|
|
@ -39,7 +39,10 @@ module.exports = function(options={}) {
|
|||
})
|
||||
|
||||
// window.webContents.on('will-navigate', (event)=>event.preventDefault())
|
||||
window.webContents.on('new-window', (event)=>event.preventDefault())
|
||||
window.webContents.on('new-window', (event, url)=>{
|
||||
event.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
|
||||
if (options.fullscreen) {
|
||||
window.webContents.on('dom-ready', ()=>{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue