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:
parent
306b722be8
commit
09ef90d3db
1 changed files with 7 additions and 1 deletions
|
@ -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: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue