main.js 566 B

12345678910111213141516171819202122232425262728
  1. const {app, BrowserWindow} = require('electron')
  2. const url = require('url')
  3. const path = require('path')
  4. let win
  5. function createWindow() {
  6. win = new BrowserWindow({
  7. width: 800,
  8. height: 600,
  9. webPreferences: {
  10. nodeIntegration: true
  11. },
  12. menu: null,
  13. })
  14. win.loadURL(url.format ({
  15. pathname: path.join(__dirname, 'index.html'),
  16. protocol: 'file:',
  17. slashes: true
  18. }))
  19. }
  20. app.on('ready', createWindow)
  21. app.on('browser-window-created',function(e,window) {
  22. window.setMenu(null);
  23. });