Open links with target="_blank" in a new window by default
This commit is contained in:
parent
b0e81e1945
commit
ddfdeee5b0
@ -1,4 +1,4 @@
|
|||||||
const { app, BrowserWindow, protocol, session } = require('electron')
|
const { app, BrowserWindow, protocol, shell } = require('electron')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
|
||||||
function createWindow () {
|
function createWindow () {
|
||||||
@ -11,6 +11,11 @@ function createWindow () {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
win.webContents.on('new-window', function(e, url) {
|
||||||
|
e.preventDefault();
|
||||||
|
shell.openExternal(url);
|
||||||
|
})
|
||||||
|
|
||||||
// The starting point of the app
|
// The starting point of the app
|
||||||
win.loadFile('./frontend/index.html')
|
win.loadFile('./frontend/index.html')
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user