Download electron/main.js from Mythus/Staging: direct link, hf CLI and curl.
- Browser
- Download file 1.28 kB
-
https://huggingface.co/spaces/Mythus/Staging/resolve/main/electron/main.js
- Command line
-
hf download hf://spaces/Mythus/Staging/electron/main.js
-
curl -L -o main.js https://huggingface.co/spaces/Mythus/Staging/resolve/main/electron/main.js
1.28 kB
| // Electron | |
| const { app, Menu } = require("electron"); | |
| const remoteMain = require("@electron/remote/main"); | |
| remoteMain.initialize(); | |
| // This method will be called when Electron has finished | |
| // initialization and is ready to create browser windows. | |
| app.allowRendererProcessReuse = true; | |
| app.on("ready", () => { | |
| // Main window | |
| const window = require("./src/window"); | |
| mainWindow = window.createBrowserWindow(app); | |
| remoteMain.enable(mainWindow.webContents); | |
| icon: 'assets\icons\win.icon.ico' | |
| // Option 1: Uses Webtag and load a custom html file with external content | |
| //mainWindow.loadURL(`file://${__dirname}/index.html`); | |
| // Option 2: Load directly an URL if you don't need interface customization | |
| mainWindow.loadURL("https://teledriveapp.herokuapp.com/startup"); | |
| // Option 3: Uses BrowserView to load an URL | |
| //const view = require("./src/view"); | |
| //view.createBrowserView(mainWindow); | |
| // Display Dev Tools | |
| //mainWindow.openDevTools(); | |
| // Menu (for standard keyboard shortcuts) | |
| const menu = require("./src/menu"); | |
| const template = menu.createTemplate(app.name); | |
| const builtMenu = Menu.buildFromTemplate(template); | |
| Menu.setApplicationMenu(builtMenu); | |
| }); | |
| // Quit when all windows are closed. | |
| app.on("window-all-closed", () => { | |
| app.quit(); | |
| }); | |