Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const {app, BrowserWindow} = require('electron');
  2. const path = require('path');
  3.  
  4. let mainWindow;
  5.  
  6. function createWindow () {
  7.     mainWindow = new BrowserWindow({
  8.         width: 800,
  9.         height: 600,
  10.     });
  11.  
  12.     mainWindow.loadURL("http://localhost:8000");
  13.  
  14.     // mainWindow.webContents.openDevTools()
  15.  
  16.     mainWindow.on('closed', function () {
  17.         mainWindow = null;
  18.     });
  19. }
  20.  
  21. app.on('ready', createWindow);
  22.  
  23. app.on('window-all-closed', function () {
  24.     if (process.platform !== 'darwin') app.quit();
  25. });
  26.  
  27. app.on('activate', function () {
  28.     if (mainWindow === null) createWindow();
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement