2020-09-14 17:36:54 +00:00
|
|
|
const { app, BrowserWindow, ipcMain } = require('electron')
|
2019-11-13 05:49:13 +00:00
|
|
|
|
2023-04-05 13:42:20 +00:00
|
|
|
ipcMain.on('create-frameless-window', (event, { url }) => {
|
2020-09-14 17:36:54 +00:00
|
|
|
const win = new BrowserWindow({ frame: false })
|
|
|
|
win.loadURL(url)
|
|
|
|
})
|
2019-11-13 05:49:13 +00:00
|
|
|
|
|
|
|
function createWindow () {
|
2020-09-14 17:36:54 +00:00
|
|
|
const mainWindow = new BrowserWindow({
|
2019-11-13 05:49:13 +00:00
|
|
|
width: 600,
|
|
|
|
height: 400,
|
|
|
|
title: 'Create a frameless window',
|
|
|
|
webPreferences: {
|
|
|
|
nodeIntegration: true
|
|
|
|
}
|
|
|
|
})
|
2020-09-14 17:36:54 +00:00
|
|
|
mainWindow.loadFile('index.html')
|
2019-11-13 05:49:13 +00:00
|
|
|
}
|
|
|
|
|
2020-02-03 22:43:22 +00:00
|
|
|
app.whenReady().then(() => {
|
2019-11-13 05:49:13 +00:00
|
|
|
createWindow()
|
|
|
|
})
|