fix window bounds, use modern method to cancel new windows
This commit is contained in:
parent
c648cfd2b3
commit
3baa262ca6
6
app.js
6
app.js
|
@ -31,14 +31,12 @@ const run = () => {
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow() {
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
const win = windowManager.createWindow(480, 320);
|
const win = windowManager.createWindow(480, 420);
|
||||||
|
|
||||||
win.loadFile('./html/index.html');
|
win.loadFile('./html/index.html');
|
||||||
|
|
||||||
attachTitlebarToWindow(win);
|
attachTitlebarToWindow(win);
|
||||||
win.webContents.on('new-window', function (e, url) {
|
win.webContents.setWindowOpenHandler(() => "deny");
|
||||||
e.preventDefault();
|
|
||||||
});
|
|
||||||
win.webContents.on('did-finish-load', function () {
|
win.webContents.on('did-finish-load', function () {
|
||||||
if (win.webContents.getZoomFactor() != 0.9)
|
if (win.webContents.getZoomFactor() != 0.9)
|
||||||
win.webContents.setZoomFactor(0.9)
|
win.webContents.setZoomFactor(0.9)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user