Skip to content

Instantly share code, notes, and snippets.

@pushkin-
Created August 22, 2023 22:39
Show Gist options
  • Save pushkin-/3b4bcdb219eee85789e95f6d94ec8a92 to your computer and use it in GitHub Desktop.
Save pushkin-/3b4bcdb219eee85789e95f6d94ec8a92 to your computer and use it in GitHub Desktop.
nonresizzblefullscren
<!DOCTYPE html>
<html>
<body>
<button onclick="window.open('https://example.com')">Open Window</button>
</body>
</html>
const { app, BrowserWindow } = require('electron')
function createWindow() {
const mainWindow = new BrowserWindow()
mainWindow.loadFile('index.html')
mainWindow.setTitle("parent");
mainWindow.webContents.setWindowOpenHandler(() => {
return {
action: "allow",
overrideBrowserWindowOptions: {
fullscreenable: false,
parent: mainWindow,
resizable: false
}
}
})
}
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', function () {
app.quit()
})
{
"name": "polite-garden-overthrow-y01a1",
"productName": "polite-garden-overthrow-y01a1",
"description": "My Electron application description",
"keywords": [],
"main": "./main.js",
"version": "1.0.0",
"author": "ishats",
"scripts": {
"start": "electron ."
},
"dependencies": {},
"devDependencies": {
"electron": "26.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment