main.js 626 B

1234567891011121314151617181920
  1. // Retrieve information about screen size, displays, cursor position, etc.
  2. //
  3. // For more info, see:
  4. // https://electronjs.org/docs/api/screen
  5. const { app, BrowserWindow } = require('electron')
  6. let mainWindow = null
  7. app.on('ready', () => {
  8. // We cannot require the screen module until the app is ready.
  9. const { screen } = require('electron')
  10. // Create a window that fills the screen's available work area.
  11. const primaryDisplay = screen.getPrimaryDisplay()
  12. const { width, height } = primaryDisplay.workAreaSize
  13. mainWindow = new BrowserWindow({ width, height })
  14. mainWindow.loadURL('https://electronjs.org')
  15. })