From 3f75e151b3bd447731606bd24b379e9844ece4b4 Mon Sep 17 00:00:00 2001 From: DeionSi Date: Fri, 13 Jan 2023 22:23:46 +0100 Subject: [PATCH] Open links in default browser --- index.html | 2 +- main.js | 8 ++++++++ package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 32fc953..b978943 100644 --- a/index.html +++ b/index.html @@ -183,7 +183,7 @@ diff --git a/main.js b/main.js index 8c834ed..26d2611 100644 --- a/main.js +++ b/main.js @@ -28,6 +28,14 @@ function createWindow () }, }); + // Open links in external browser + win.webContents.setWindowOpenHandler(({ url }) => { + if (url.startsWith('https:')) { + require('electron').shell.openExternal(url); + } + return { action: 'deny' }; + }); + // auto hide menu bar (Win, Linux) win.setMenuBarVisibility(false); win.setAutoHideMenuBar(true); diff --git a/package.json b/package.json index 56d08e0..fc08f7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "speedyloader", - "version": "1.5.0", + "version": "1.5.1", "description": "Speeduino universal firmware loader", "main": "main.js", "scripts": {