mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-11-29 18:38:48 +03:00
Make URLs open in default browser
This commit is contained in:
parent
6553ee9965
commit
86028b5c9b
1 changed files with 8 additions and 1 deletions
9
entry.js
9
entry.js
|
@ -1,4 +1,4 @@
|
|||
const { app, BrowserWindow, ipcMain, Notification } = require('electron');
|
||||
const { app, BrowserWindow, ipcMain, Notification, shell } = require('electron');
|
||||
const path = require('path');
|
||||
|
||||
let mainWindow;
|
||||
|
@ -25,6 +25,13 @@ function createWindow ()
|
|||
|
||||
mainWindow.loadFile(path.join(__dirname, 'public', 'html', 'index.html'));
|
||||
|
||||
// open URLs in Browser instead of an pop-up in electron app.
|
||||
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||
shell.openExternal(url);
|
||||
return { action: 'deny' };
|
||||
});
|
||||
|
||||
|
||||
// mainWindow.webContents.openDevTools();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue