Skip to content

Commit

Permalink
Open external links in system browser
Browse files Browse the repository at this point in the history
  • Loading branch information
ozellpaukert committed Jan 17, 2025
1 parent ae61c96 commit 2da301e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/labview/labview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
clipboard,
dialog,
Menu,
MenuItemConstructorOptions
MenuItemConstructorOptions,
shell
} from 'electron';
import log from 'electron-log';
import * as path from 'path';
Expand Down Expand Up @@ -63,6 +64,12 @@ export class LabView implements IDisposable {
}
});

// Open external links in system browser
this._view.webContents.setWindowOpenHandler(({ url }) => {
shell.openExternal(url);
return { action: 'deny' };
});

this._view.setBackgroundColor(
options.isDarkTheme ? DarkThemeBGColor : LightThemeBGColor
);
Expand Down

0 comments on commit 2da301e

Please sign in to comment.