2020-09-14 17:36:54 +00:00
|
|
|
const { shell, ipcRenderer } = require('electron')
|
2020-01-13 06:35:56 +00:00
|
|
|
|
|
|
|
const newWindowBtn = document.getElementById('new-window')
|
|
|
|
const link = document.getElementById('browser-window-link')
|
|
|
|
|
|
|
|
newWindowBtn.addEventListener('click', (event) => {
|
2020-09-14 17:36:54 +00:00
|
|
|
const url = 'https://electronjs.org'
|
2023-04-05 13:42:20 +00:00
|
|
|
ipcRenderer.send('new-window', { url, width: 400, height: 320 })
|
2020-01-13 06:35:56 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
link.addEventListener('click', (e) => {
|
|
|
|
e.preventDefault()
|
2023-08-10 09:55:52 +00:00
|
|
|
shell.openExternal('https://www.electronjs.org/docs/latest/api/browser-window')
|
2020-01-13 06:35:56 +00:00
|
|
|
})
|