Skip to content

Instantly share code, notes, and snippets.

@CharlieHess
Last active October 14, 2020 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CharlieHess/20f71eb5a9f0bb8640ae24937b570a64 to your computer and use it in GitHub Desktop.
Save CharlieHess/20f71eb5a9f0bb8640ae24937b570a64 to your computer and use it in GitHub Desktop.
paintWhenInitiallyHidden
const {app, BrowserWindow} = require('electron')
let mainWindow
function createWindow () {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
show: false,
paintWhenInitiallyHidden: false,
webPreferences: {
contextIsolation: true,
sandbox: true,
}
})
mainWindow.loadURL('https://www.google.com')
mainWindow.hide()
}
app.on('ready', createWindow)
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
mainWindow.show()
mainWindow.focus()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment