Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

env.ts

8 lines368 Bytes

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