Mythus/Staging
0
1// Electron2const { app, Menu } = require("electron");3const remoteMain = require("@electron/remote/main");4remoteMain.initialize();5 6// This method will be called when Electron has finished7// initialization and is ready to create browser windows.8app.allowRendererProcessReuse = true;9app.on("ready", () => {10 // Main window11 const window = require("./src/window");12 mainWindow = window.createBrowserWindow(app);13 remoteMain.enable(mainWindow.webContents);14 icon: 'assets\icons\win.icon.ico'15 // Option 1: Uses Webtag and load a custom html file with external content16 //mainWindow.loadURL(`file://${__dirname}/index.html`);17 18 // Option 2: Load directly an URL if you don't need interface customization19mainWindow.loadURL("https://teledriveapp.herokuapp.com/startup");20 21 // Option 3: Uses BrowserView to load an URL22 //const view = require("./src/view");23 //view.createBrowserView(mainWindow);24 25 // Display Dev Tools26 //mainWindow.openDevTools();27 28 // Menu (for standard keyboard shortcuts)29 const menu = require("./src/menu");30 const template = menu.createTemplate(app.name);31 const builtMenu = Menu.buildFromTemplate(template);32 Menu.setApplicationMenu(builtMenu);33});34 35// Quit when all windows are closed.36app.on("window-all-closed", () => {37 app.quit();38});39 