main.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. const electron = require('electron')
  2. // require('electron-debug')({ showDevTools: true })
  3. const app = electron.app
  4. const BrowserWindow = electron.BrowserWindow
  5. const path = require('path')
  6. const url = require('url')
  7. let mainWindow
  8. function createWindow () {
  9. mainWindow = new BrowserWindow({
  10. toobar: true,
  11. width: 800,
  12. height: 600,
  13. webPreferences: {
  14. nodeIntegration: false
  15. }
  16. })
  17. // and load the index.html of the app.
  18. // mainWindow.loadURL(url.format({
  19. // pathname: path.join(__dirname, 'index.html'),
  20. // protocol: 'file:',
  21. // slashes: true
  22. // }))
  23. mainWindow.loadURL('http://181.40.66.126:10500')
  24. // mainWindow.setMenu(null)
  25. mainWindow.setMenuBarVisibility(false)
  26. mainWindow.maximize()
  27. mainWindow.on('closed', function () {
  28. mainWindow = null
  29. })
  30. }
  31. app.on('ready', createWindow)
  32. app.on('window-all-closed', function () {
  33. if (process.platform !== 'darwin') {
  34. app.quit()
  35. }
  36. })
  37. app.on('activate', function () {
  38. // On OS X it's common to re-create a window in the app when the
  39. // dock icon is clicked and there are no other windows open.
  40. if (mainWindow === null) {
  41. createWindow()
  42. }
  43. })
  44. // In this file you can include the rest of your app's specific main process
  45. // code. You can also put them in separate files and require them here.