-
-
Save rvcalisto/a8e35699d18189d1d74cada4965ee779 to your computer and use it in GitHub Desktop.
Electron SIGSEGV on browserWindow maximize
This file contains 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
<!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> |
This file contains 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'); | |
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(); | |
}); |
This file contains 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
{ | |
"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