mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +01:00
Electron main process to load SWITCH
cgen-a00775aa4d904ece9e32303631a6e44e
This commit is contained in:
parent
9e5fe63e47
commit
47ddc93c1b
1 changed files with 14 additions and 0 deletions
14
website/electron-main.js
Normal file
14
website/electron-main.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
const { app, BrowserWindow } = require('electron');
|
||||
const path = require('path');
|
||||
|
||||
function createWindow() {
|
||||
const win = new BrowserWindow({ width: 1280, height: 800, webPreferences: { nodeIntegration: false, contextIsolation: true } });
|
||||
const startUrl = process.env.SWITCH_URL || 'http://localhost:8080/switch.html';
|
||||
win.loadURL(startUrl);
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
app.on('activate', () => { if (BrowserWindow.getAllWindows().length === 0) createWindow(); });
|
||||
});
|
||||
app.on('window-all-closed', () => { if (process.platform !== 'darwin') app.quit(); });
|
||||
Loading…
Add table
Add a link
Reference in a new issue