Files
t3code/apps/web/src/env.ts
2026-02-09 22:19:49 -08:00

9 lines
368 B
TypeScript

/**
* True when running inside the Electron preload bridge, false in a regular browser.
* The preload script sets window.nativeApi via contextBridge before any web-app
* code executes, so this is reliable at module load time.
*/
export const isElectron =
typeof window !== "undefined" &&
(window.desktopBridge !== undefined || window.nativeApi !== undefined);