Guest User

Untitled

a guest
Dec 11th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. const { app, BrowserWindow } = require('electron')
  2. const path = require('path')
  3. const url = require('url')
  4.  
  5. let win
  6.  
  7. function createWindow() {
  8. win = new BrowserWindow({ frame: false, backgroundColor: '#333333' })
  9. win.setMenu(null)
  10. win.maximize()
  11. win.setMaximizable(false)
  12. win.setResizable(false)
  13. win.loadURL(url.format({
  14. pathname: path.join(__dirname, 'index.html'),
  15. protocol: 'file:',
  16. slashes: true
  17. }))
  18. win.on('closed', () => {
  19. win = null
  20. })
  21. }
  22. app.on('ready', createWindow)
  23. app.on('window-all-closed', () => {
  24. app.quit()
  25. })
  26. app.on('active', () => {
  27. if (win === null) {
  28. createWindow()
  29. }
  30. })
Add Comment
Please, Sign In to add comment