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 }