b14b876d50
* refactor: replace Array.prototype.forEach.call with plain for-of * fix: add missing contextIsolation: false * fix: open links in default browser
23 lines
515 B
JavaScript
23 lines
515 B
JavaScript
const { app, BrowserWindow, ipcMain } = require('electron')
|
|
|
|
ipcMain.on('create-frameless-window', (event, { url }) => {
|
|
const win = new BrowserWindow({ frame: false })
|
|
win.loadURL(url)
|
|
})
|
|
|
|
function createWindow () {
|
|
const mainWindow = new BrowserWindow({
|
|
width: 600,
|
|
height: 400,
|
|
title: 'Create a frameless window',
|
|
webPreferences: {
|
|
contextIsolation: false,
|
|
nodeIntegration: true
|
|
}
|
|
})
|
|
mainWindow.loadFile('index.html')
|
|
}
|
|
|
|
app.whenReady().then(() => {
|
|
createWindow()
|
|
})
|