You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.js 1003B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. const { app, BrowserWindow } = require('electron')
  2. //const { spawn } = require("child_process");
  3. function createWindow() {
  4. // Crea la ventana del navegador.
  5. let win = new BrowserWindow({
  6. minHeight: 768,
  7. minWidth: 1366,
  8. width: 1366,
  9. height: 768,
  10. webPreferences: {
  11. nodeIntegration: true
  12. },
  13. autoHideMenuBar: true
  14. })
  15. // y carga el index.html de la aplicación.
  16. win.loadFile('build/index.html')
  17. }
  18. app.whenReady().then(() => {
  19. createWindow()
  20. })
  21. // Finaliza cuando todas las ventanas estén cerradas.
  22. app.on('window-all-closed', () => {
  23. // En macOS es común para las aplicaciones y sus barras de menú
  24. // que estén activas hasta que el usuario salga explicitamente con Cmd + Q
  25. if (process.platform !== 'darwin') {
  26. app.quit()
  27. }
  28. })
  29. app.on('activate', () => {
  30. // En macOS es común volver a crear una ventana en la aplicación cuando el
  31. // icono del dock es clicado y no hay otras ventanas abiertas.
  32. if (BrowserWindow.getAllWindows().length === 0) {
  33. createWindow()
  34. }
  35. })