mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-02-27 21:01:00 +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');
|
const path = require('path');
|
||||||
|
|
||||||
let mainWindow;
|
let mainWindow;
|
||||||
|
@ -25,6 +25,13 @@ function createWindow ()
|
||||||
|
|
||||||
mainWindow.loadFile(path.join(__dirname, 'public', 'html', 'index.html'));
|
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();
|
// mainWindow.webContents.openDevTools();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue