From d20810e67834be6b6a79fd96cc0495f4e1e2321a Mon Sep 17 00:00:00 2001 From: Gri-ffin Date: Tue, 2 Jan 2024 14:06:18 +0100 Subject: [PATCH] open social media in default browser instead of electron window --- electron/main.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/electron/main.ts b/electron/main.ts index 4ddf4df56..257842cf5 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -68,6 +68,12 @@ function createMainWindow() { if (process.platform !== 'darwin') app.quit() }) + /* Open external links in the default browser */ + mainWindow.webContents.setWindowOpenHandler(({ url }) => { + require('electron').shell.openExternal(url) + return { action: 'deny' } + }) + /* Enable dev tools for development */ if (!app.isPackaged) mainWindow.webContents.openDevTools() }