()
| 77 | } |
| 78 | |
| 79 | export function isDesktopRuntime(): boolean { |
| 80 | if (FORCE_DESKTOP_RUNTIME) { |
| 81 | return true; |
| 82 | } |
| 83 | |
| 84 | if (typeof window === 'undefined') { |
| 85 | return false; |
| 86 | } |
| 87 | |
| 88 | return detectDesktopRuntime({ |
| 89 | hasTauriGlobals: '__TAURI_INTERNALS__' in window || '__TAURI__' in window, |
| 90 | userAgent: window.navigator?.userAgent ?? '', |
| 91 | locationProtocol: window.location?.protocol ?? '', |
| 92 | locationHost: window.location?.host ?? '', |
| 93 | locationOrigin: window.location?.origin ?? '', |
| 94 | }); |
| 95 | } |
| 96 | |
| 97 | export function getApiBaseUrl(): string { |
| 98 | if (!isDesktopRuntime()) { |
no test coverage detected