File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 66 clipboard ,
77 dialog ,
88 Menu ,
9- MenuItemConstructorOptions
9+ MenuItemConstructorOptions ,
10+ shell
1011} from 'electron' ;
1112import log from 'electron-log' ;
1213import * as path from 'path' ;
@@ -63,6 +64,17 @@ export class LabView implements IDisposable {
6364 }
6465 } ) ;
6566
67+ // Open external links in system browser
68+ this . _view . webContents . setWindowOpenHandler ( ( { url } ) => {
69+ const jlab_host = `${ sessionConfig . url . protocol } //${ sessionConfig . url . host } `
70+ if ( url . startsWith ( jlab_host ) ) {
71+ return { action : 'allow' } ;
72+ } else {
73+ shell . openExternal ( url ) ;
74+ return { action : 'deny' } ;
75+ }
76+ } ) ;
77+
6678 this . _view . setBackgroundColor (
6779 options . isDarkTheme ? DarkThemeBGColor : LightThemeBGColor
6880 ) ;
You can’t perform that action at this time.
0 commit comments