From 3baa262ca65f8a550dc8e0a37e4b931cc3da1ba7 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Sun, 16 Oct 2022 16:06:06 +0200 Subject: [PATCH] fix window bounds, use modern method to cancel new windows --- app.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 851a5bd..63c31e1 100644 --- a/app.js +++ b/app.js @@ -31,14 +31,12 @@ const run = () => { function createWindow() { // Create the browser window. - const win = windowManager.createWindow(480, 320); + const win = windowManager.createWindow(480, 420); win.loadFile('./html/index.html'); attachTitlebarToWindow(win); - win.webContents.on('new-window', function (e, url) { - e.preventDefault(); - }); + win.webContents.setWindowOpenHandler(() => "deny"); win.webContents.on('did-finish-load', function () { if (win.webContents.getZoomFactor() != 0.9) win.webContents.setZoomFactor(0.9)