Last active
October 5, 2021 07:20
-
-
Save CliffReimers/cfc4784579006b79cef11c34c3a042b5 to your computer and use it in GitHub Desktop.
Window resizes when setting resizable: false
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"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<title>Hello World!</title> | |
</head> | |
<body> | |
</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('path') | |
function createWindow () { | |
const mainWindow = new BrowserWindow({ | |
width: 800, | |
height: 600 | |
}) | |
mainWindow.removeMenu(); | |
let resizable = true; | |
setInterval(() => { | |
resizable = !resizable; | |
mainWindow.setResizable(resizable); | |
console.log(mainWindow.getContentSize()); | |
}, 2000); | |
} | |
app.whenReady().then(() => { | |
createWindow() | |
}) |
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": "periodic-taste-snatch-95q6d", | |
"productName": "periodic-taste-snatch-95q6d", | |
"description": "My Electron application description", | |
"keywords": [], | |
"main": "./main.js", | |
"version": "1.0.0", | |
"author": "DavidReimers", | |
"scripts": { | |
"start": "electron ." | |
}, | |
"dependencies": {}, | |
"devDependencies": { | |
"electron": "13.5.1" | |
} | |
} |
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
// |
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
// |
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
/* Empty */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment