diff --git a/apps/remixdesktop/src/main.ts b/apps/remixdesktop/src/main.ts index ed02946993..1b75ec0216 100644 --- a/apps/remixdesktop/src/main.ts +++ b/apps/remixdesktop/src/main.ts @@ -1,4 +1,4 @@ -import { app, BrowserWindow, dialog, Menu, MenuItem, utilityProcess } from 'electron'; +import { app, BrowserWindow, dialog, Menu, MenuItem, shell, utilityProcess } from 'electron'; import path from 'path'; @@ -27,6 +27,10 @@ export const createWindow = async (dir?: string): Promise => { preload: path.join(__dirname, 'preload.js') }, }); + mainWindow.webContents.setWindowOpenHandler((details) => { + shell.openExternal(details.url); // Open URL in user's browser. + return { action: "deny" }; // Prevent the app from opening the URL. + }) if (dir && dir.endsWith('/')) dir = dir.slice(0, -1) const params = dir ? `?opendir=${encodeURIComponent(dir)}` : ''; // and load the index.html of the app.