mirror of
https://github.com/Killua67/Fusion_Ai.git
synced 2025-11-25 02:54:55 +08:00
30 lines
689 B
JavaScript
30 lines
689 B
JavaScript
const { app, BrowserWindow, session } = require('electron');
|
|
const path = require('path');
|
|
|
|
function createWindow() {
|
|
const mainWindow = new BrowserWindow({
|
|
width: 1600,
|
|
height: 1200,
|
|
webPreferences: {
|
|
nodeIntegration: true,
|
|
contextIsolation: false,
|
|
webviewTag: true
|
|
}
|
|
});
|
|
|
|
mainWindow.loadFile('index.html');
|
|
// 开发时打开开发者工具
|
|
// mainWindow.webContents.openDevTools();
|
|
}
|
|
|
|
app.whenReady().then(() => {
|
|
createWindow();
|
|
|
|
app.on('activate', function () {
|
|
if (BrowserWindow.getAllWindows().length === 0) createWindow();
|
|
});
|
|
});
|
|
|
|
app.on('window-all-closed', function () {
|
|
if (process.platform !== 'darwin') app.quit();
|
|
});
|