26 lines
652 B
JavaScript
26 lines
652 B
JavaScript
// main.js
|
|
const { app, BrowserWindow, nativeImage } = require('electron');
|
|
const path = require('path');
|
|
|
|
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = "true";
|
|
|
|
function createWindow() {
|
|
const win = new BrowserWindow({
|
|
show: false, // window is hidden
|
|
width: 1200,
|
|
height: 800,
|
|
webPreferences: {
|
|
nodeIntegration: true,
|
|
contextIsolation: false,
|
|
icon: path.join(__dirname, '_', 'fabric.png')
|
|
}
|
|
});
|
|
win.loadFile(path.join(__dirname, 'index.html'));
|
|
win.webContents.openDevTools({ mode: 'undocked' });
|
|
}
|
|
|
|
app.whenReady().then(createWindow);
|
|
|
|
app.on('window-all-closed', () => {
|
|
if (process.platform !== 'darwin') app.quit();
|
|
}); |