Skip to content

Commit 2da301e

Browse files
committed
Open external links in system browser
1 parent ae61c96 commit 2da301e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/labview/labview.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
clipboard,
77
dialog,
88
Menu,
9-
MenuItemConstructorOptions
9+
MenuItemConstructorOptions,
10+
shell
1011
} from 'electron';
1112
import log from 'electron-log';
1213
import * as path from 'path';
@@ -63,6 +64,12 @@ export class LabView implements IDisposable {
6364
}
6465
});
6566

67+
// Open external links in system browser
68+
this._view.webContents.setWindowOpenHandler(({ url }) => {
69+
shell.openExternal(url);
70+
return { action: 'deny' };
71+
});
72+
6673
this._view.setBackgroundColor(
6774
options.isDarkTheme ? DarkThemeBGColor : LightThemeBGColor
6875
);

0 commit comments

Comments
 (0)