Expand description
Authoritative platform detection for the renderer.
Frontend code used to lean on navigator.userAgent, which lies on
Linux WebViews that masquerade as Mac/Safari for compatibility.
Rust knows the host OS for certain via std::env::consts::OS, so
this module exposes it as a Tauri command and the renderer caches
the result through its usePlatform() hook.
Functions§
- get_
platform - Return the host platform string as known to Rust:
"macos","linux","windows", etc. — the value ofstd::env::consts::OS. The renderer normalises this throughnormalisePlatforminlib/platform.ts.