Skip to content

Instantly share code, notes, and snippets.

@rvcalisto
Created April 24, 2024 15:20
Show Gist options
  • Save rvcalisto/a8e35699d18189d1d74cada4965ee779 to your computer and use it in GitHub Desktop.
Save rvcalisto/a8e35699d18189d1d74cada4965ee779 to your computer and use it in GitHub Desktop.
Electron SIGSEGV on browserWindow maximize
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello World!</title>
</head>
<body>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
margin: auto;
max-width: 38rem;
padding: 2rem;
}
</style>
<h1>💖 Hello World!</h1>
<p>Welcome to your Electron application.</p>
</body>
</html>
const { app, BrowserWindow } = require('electron');
const path = require('node:path');
function newWindow() {
// Create the browser window.
const browserWindow = new BrowserWindow({
width: 800,
height: 600
});
// and load the index.html of the app.
browserWindow.loadFile(path.join(__dirname, 'index.html'));
return browserWindow;
};
async function waitSeconds(seconds) {
await new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, seconds * 1000);
});
}
app.whenReady().then(async () => {
newWindow();
await waitSeconds(1);
newWindow();
await waitSeconds(1);
const win = newWindow();
await waitSeconds(1);
win.maximize();
});
app.on('window-all-closed', () => {
app.quit();
});
{
"name": "electron-sigsegv-maximize",
"productName": "electron-sigsegv-maximize",
"version": "1.0.0",
"description": "My Electron application description",
"main": "index.js",
"scripts": {
"start": "electron ."
},
"devDependencies": {
"electron": "31.0.0-alpha.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment