()
| 8 | } |
| 9 | |
| 10 | function getElectronShell(): ElectronShell | null { |
| 11 | try { |
| 12 | const req = (window as unknown as { require?: (id: string) => unknown }).require; |
| 13 | if (typeof req !== "function") return null; |
| 14 | const mod = req("electron") as ElectronModule | undefined; |
| 15 | return mod?.shell ?? null; |
| 16 | } catch { |
| 17 | return null; |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | export function openExternal(url: string): void { |
| 22 | const shell = getElectronShell(); |
no outgoing calls
no test coverage detected