1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-15 12:25:13 +03:00

Fix issue with opening external links in app's window.

This commit is contained in:
bfmvsa 2024-06-23 16:29:31 +02:00
parent 306b722be8
commit 09ef90d3db

View file

@ -1,4 +1,4 @@
const { app, BrowserWindow, ipcMain, Menu, MenuItem } = require('electron'); const { app, BrowserWindow, ipcMain, Menu, MenuItem, shell } = require('electron');
const windowStateKeeper = require('electron-window-state'); const windowStateKeeper = require('electron-window-state');
const path = require('path'); const path = require('path');
const Store = require('electron-store'); const Store = require('electron-store');
@ -148,6 +148,12 @@ function createWindow() {
}); });
mainWindow.webContents.setWindowOpenHandler(({ url }) => { mainWindow.webContents.setWindowOpenHandler(({ url }) => {
// Open links starts with https:// in default browser
if (url.startsWith('https://')) {
shell.openExternal(url);
return { action: 'deny' };
}
return { return {
action: 'allow', action: 'allow',
overrideBrowserWindowOptions: { overrideBrowserWindowOptions: {