mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 20:16:15 -08:00
fix: route external links to the OS default browser instead of new window
Entire-Checkpoint: c6e522b4276c
This commit is contained in:
1 parent
ff605fc024
commit
8ca2e927a2
1 file changed
+7
-5
@@ -191,11 +191,13 @@ export default class App {
|
||||
App.mainWindow.show();
|
||||
});
|
||||
|
||||
// handle all external redirects in a new browser window
|
||||
// App.mainWindow.webContents.on('will-navigate', App.onRedirect);
|
||||
// App.mainWindow.webContents.on('new-window', (event, url, frameName, disposition, options) => {
|
||||
// App.onRedirect(event, url);
|
||||
// });
|
||||
// Route target="_blank" / window.open() to the OS default browser
|
||||
App.mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||
if (/^https?:\/\//.test(url)) {
|
||||
shell.openExternal(url);
|
||||
}
|
||||
return { action: 'deny' };
|
||||
});
|
||||
|
||||
// Emitted when the window is closed.
|
||||
App.mainWindow.on('closed', () => {
|
||||
|
||||
Reference in new issue
Block a user