fix(desktop): gate external URL protocols centrally (#11311)

This commit is contained in:
Jasper
2026-08-19 16:54:21 +00:00
committed by GitHub
parent 0ede20cc5b
commit fd9f76d9aa
25 changed files with 332 additions and 645 deletions
+3 -2
View File
@@ -3,6 +3,7 @@ import { Recipe } from './recipe';
import type { GooseApp } from './types/apps';
import type { Settings, SettingKey } from './utils/settings';
import { defaultSettings } from './utils/settings';
import type { OpenExternalUrlResult } from './utils/urlSecurity';
// Mapping from settings keys to their old localStorage keys for lazy migration
const localStorageKeyMap: Partial<Record<SettingKey, string>> = {
@@ -158,7 +159,7 @@ type ElectronAPI = {
theme: string;
tokensUpdated?: boolean;
}) => void;
openExternal: (url: string) => Promise<void>;
openExternal: (url: string) => Promise<OpenExternalUrlResult>;
// Update-related functions
getVersion: () => string;
checkForUpdates: () => Promise<{ updateInfo: unknown; error: string | null }>;
@@ -300,7 +301,7 @@ const electronAPI: ElectronAPI = {
}) => {
ipcRenderer.send('broadcast-theme-change', themeData);
},
openExternal: (url: string): Promise<void> => {
openExternal: (url: string): Promise<OpenExternalUrlResult> => {
return ipcRenderer.invoke('open-external', url);
},
getVersion: (): string => {