Skip to content

Instantly share code, notes, and snippets.

@pushkin-

pushkin-/main.js Secret

Created January 11, 2023 21:53
Show Gist options
  • Save pushkin-/71fa3427e8a836915dba6377c8ed8a97 to your computer and use it in GitHub Desktop.
Save pushkin-/71fa3427e8a836915dba6377c8ed8a97 to your computer and use it in GitHub Desktop.
readytoshow
(async () => {
const {app, BrowserWindow} = require("electron");
await app.whenReady()
const win = new BrowserWindow({webPreferences: { nativeWindowOpen: true }});
await win.loadURL("https://google.com");
win.webContents.openDevTools();
win.webContents.setWindowOpenHandler(() => {
return { action: "allow", overrideBrowserWindowOptions: {
show: false
}}
});
win.webContents.on("did-create-window", (win) => {
win.once("ready-to-show", () => {
win.show();
});
});
})();
{
"name": "naughty-variation-warn-ffjg2",
"productName": "naughty-variation-warn-ffjg2",
"description": "My Electron application description",
"keywords": [],
"main": "./main.js",
"version": "1.0.0",
"author": "ishats",
"scripts": {
"start": "electron ."
},
"dependencies": {},
"devDependencies": {
"electron": "22.0.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment