Skip to content

Commit 284d9c4

Browse files
committed
fix: open link to default browser
1 parent 14ef48b commit 284d9c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

electron/window/create-database.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ThemeType } from "@/context/theme-provider";
22
import { ConnectionStoreItem } from "@/lib/conn-manager-store";
3-
import { BrowserWindow } from "electron";
3+
import { BrowserWindow, shell } from "electron";
44
import { ConnectionPool } from "../connection-pool";
55
import { getWindowConfig, isDev } from "../utils";
66
import { MainWindow } from "./main-window";
@@ -45,6 +45,12 @@ export function createDatabaseWindow(ctx: {
4545
dbWindow.destroy();
4646
});
4747

48+
// Open in the default web browser
49+
dbWindow.webContents.setWindowOpenHandler(({ url }) => {
50+
shell.openExternal(url);
51+
return { action: "deny" }; // Prevent opening in Electron
52+
});
53+
4854
const EMBEDED_STUDIO_ENDPOINT =
4955
process.env.STUDIO_ENDPOINT || STUDIO_ENDPOINT;
5056

0 commit comments

Comments
 (0)