@@ -421,11 +421,14 @@ const mobileEndorsementRows = [
421421<script >
422422 import { fetchLatestRelease, RELEASES_URL, type ReleaseAsset } from "../lib/releases";
423423 import { startHomeMotion } from "../lib/homeMotion";
424+ import { ANDROID_PLAY_STORE_URL } from "../lib/site";
424425
425- type Platform = { os: "mac" | "win" | "linux"; label: string };
426+ type Platform = { os: "mac" | "win" | "linux" | "android" ; label: string };
426427
427428 function detectPlatform(): Platform | null {
428429 const ua = navigator.userAgent;
430+ // Match Android first because Android browsers also include Linux in their user agent.
431+ if (/Android/i.test(ua)) return { os: "android", label: "Get it on Google Play" };
429432 if (/Win/i.test(ua)) return { os: "win", label: "Download for Windows" };
430433 if (/Mac/i.test(ua)) return { os: "mac", label: "Download for macOS" };
431434 if (/Linux/i.test(ua)) return { os: "linux", label: "Download for Linux" };
@@ -462,6 +465,15 @@ const mobileEndorsementRows = [
462465 if (label) label.textContent = platform.label;
463466 if (ctaLabel) ctaLabel.textContent = platform.label;
464467 if (kbd && platform.os !== "mac") kbd.textContent = "Ctrl ⏎";
468+ if (platform.os === "android") {
469+ for (const androidBtn of [btn, ctaBtn]) {
470+ if (!androidBtn) continue;
471+ androidBtn.href = ANDROID_PLAY_STORE_URL;
472+ androidBtn.target = "_blank";
473+ androidBtn.rel = "noopener noreferrer";
474+ }
475+ return;
476+ }
465477
466478 try {
467479 const release = await fetchLatestRelease();
0 commit comments