fix: open project action links in browser

Project action URLs now open in the system browser from Electron
Adds a safe Electron shell bridge for external HTTP links
This commit is contained in:
Bohdan Triapitsyn
2026-04-27 14:24:20 +03:00
parent 6470d9d205
commit 54a09914ac
2 changed files with 16 additions and 0 deletions
+13
View File
@@ -1746,6 +1746,19 @@ const handleInvoke = async (browserWindow, command, args = {}) => {
return null;
}
case 'desktop_open_external_url': {
const target = typeof args.url === 'string' ? args.url.trim() : '';
if (!target) throw new Error('URL is required');
const parsed = new URL(target);
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {
throw new Error('Only HTTP URLs can be opened externally');
}
await shell.openExternal(parsed.toString());
return null;
}
case 'desktop_reveal_path': {
const targetPath = typeof args.path === 'string' ? args.path.trim() : '';
if (!targetPath) {
+3
View File
@@ -137,6 +137,9 @@ contextBridge.exposeInMainWorld('__TAURI__', {
dialog: {
open: (options) => ipcRenderer.invoke('openchamber:dialog:open', options || {}),
},
shell: {
open: (url) => ipcRenderer.invoke('openchamber:invoke', 'desktop_open_external_url', { url }),
},
event: {
listen: async (event, handler) => addListener(event, handler),
},