Answers for "electron index file"

5

electron quickstart guide

const { app, BrowserWindow } = require('electron')

function createWindow () {
  const win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      nodeIntegration: true
    }
  })

  win.loadFile('index.html')
  win.webContents.openDevTools()
}

app.whenReady().then(createWindow)

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () => {
  if (BrowserWindow.getAllWindows().length === 0) {
    createWindow()
  }
})
Posted by: Guest on November-24-2020
1

electron quickstart guide

mkdir my-electron-app && cd my-electron-app
npm init -y
npm i --save-dev electron
Posted by: Guest on November-24-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language