Last active
October 14, 2020 20:17
-
-
Save CharlieHess/20f71eb5a9f0bb8640ae24937b570a64 to your computer and use it in GitHub Desktop.
paintWhenInitiallyHidden
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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