Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

59 righe
1.7 KiB

  1. const {
  2. app,
  3. BrowserWindow
  4. } = require('electron')
  5. // Keep a global reference of the window object, if you don't, the window will
  6. // be closed automatically when the JavaScript object is garbage collected.
  7. let win
  8. function createWindow() {
  9. // Create the browser window.
  10. win = new BrowserWindow({
  11. width: 800,
  12. height: 600,
  13. frame: true,
  14. title: 'Isleward'
  15. });
  16. win.maximize();
  17. // and load the index.html of the app.
  18. //win.loadURL(`http://default-environment.9ymkeaciiv.eu-west-1.elasticbeanstalk.com/index.html`)
  19. win.loadURL(`http://localhost:4000/index.html`)
  20. // Open the DevTools.
  21. //win.webContents.openDevTools()
  22. // Emitted when the window is closed.
  23. win.on('closed', () => {
  24. // Dereference the window object, usually you would store windows
  25. // in an array if your app supports multi windows, this is the time
  26. // when you should delete the corresponding element.
  27. win = null
  28. })
  29. }
  30. // This method will be called when Electron has finished
  31. // initialization and is ready to create browser windows.
  32. // Some APIs can only be used after this event occurs.
  33. app.on('ready', createWindow)
  34. // Quit when all windows are closed.
  35. app.on('window-all-closed', () => {
  36. // On macOS it is common for applications and their menu bar
  37. // to stay active until the user quits explicitly with Cmd + Q
  38. if (process.platform !== 'darwin') {
  39. app.quit()
  40. }
  41. })
  42. app.on('activate', () => {
  43. // On macOS it's common to re-create a window in the app when the
  44. // dock icon is clicked and there are no other windows open.
  45. if (win === null) {
  46. createWindow()
  47. }
  48. })
  49. // In this file you can include the rest of your app's specific main process
  50. // code. You can also put them in separate files and require them here.