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

pull/2122/head
bfmvsa 3 months ago
parent 306b722be8
commit 09ef90d3db

@ -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 path = require('path');
const Store = require('electron-store');
@ -148,6 +148,12 @@ function createWindow() {
});
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
// Open links starts with https:// in default browser
if (url.startsWith('https://')) {
shell.openExternal(url);
return { action: 'deny' };
}
return {
action: 'allow',
overrideBrowserWindowOptions: {

Loading…
Cancel
Save