electron launcher
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
828 B

const { BrowserWindow } = require('electron')
const path = require('path')
const { MANUAL_CREATED_FLAG } = require('../../constant')
function createWindow(url,options,node=false) {
// let areaSize = require('electron').screen.getPrimaryDisplay().workAreaSize
const window = new BrowserWindow({
// width: 870,
// height: 530,
webPreferences: {
webSecurity: false,
contextIsolation: false,
enableRemoteModule:true,
nodeIntegration: node,
preload: path.join(__dirname, 'preload.js')
},
...options
})
window[MANUAL_CREATED_FLAG] = true
console.log('openWindow', url)
window.loadURL(url)
// window.webContents.openDevTools() // Open the DevTools.
return window
}
module.exports = { createWindow }