@@ -391,46 +391,27 @@ const mobileEndorsementRows = [
391391
392392<script >
393393 import { fetchLatestRelease, RELEASES_URL, type ReleaseAsset } from "../lib/releases";
394- import { macArchFromGpuRenderer } from "../lib/macArch";
395394
396- type Platform = { os: "mac" | "win" | "linux"; label: string; arch?: string };
397-
398- // navigator.userAgent reports "Intel Mac OS X" on both Intel and Apple Silicon
399- // Macs, so probe the GPU renderer instead: Apple Silicon exposes an "Apple" GPU.
400- function detectMacArch(): "arm64" | "x64" {
401- try {
402- const canvas = document.createElement("canvas");
403- const gl = (canvas.getContext("webgl") ||
404- canvas.getContext("experimental-webgl")) as WebGLRenderingContext | null;
405- const debugInfo = gl?.getExtension("WEBGL_debug_renderer_info");
406- if (gl && debugInfo) {
407- const renderer = String(gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) ?? "");
408- return macArchFromGpuRenderer(renderer);
409- }
410- } catch {
411- // fall through to the default below
412- }
413- return macArchFromGpuRenderer("");
414- }
395+ type Platform = { os: "mac" | "win" | "linux"; label: string };
415396
416397 function detectPlatform(): Platform | null {
417398 const ua = navigator.userAgent;
418399 if (/Win/i.test(ua)) return { os: "win", label: "Download for Windows" };
419- if (/Mac/i.test(ua)) {
420- return { os: "mac", label: "Download for macOS", arch: detectMacArch() };
421- }
400+ if (/Mac/i.test(ua)) return { os: "mac", label: "Download for macOS" };
422401 if (/Linux/i.test(ua)) return { os: "linux", label: "Download for Linux" };
423402 return null;
424403 }
425404
405+ // Macs always get the arm64 build. Browsers cannot reliably tell Apple Silicon
406+ // from Intel (the UA lies, GPU strings lie), and a wrong guess hands an Apple
407+ // Silicon user a broken app. Intel users pick their build on /download.
408+ // Do NOT add arch detection back here.
426409 function pickAsset(assets: ReleaseAsset[], platform: Platform): string | null {
427410 if (platform.os === "win") {
428411 return assets.find((a) => a.name.endsWith("-x64.exe"))?.browser_download_url ?? null;
429412 }
430413 if (platform.os === "mac") {
431- const preferred = assets.find((a) => a.name.endsWith(`-${platform.arch}.dmg`));
432- const fallback = assets.find((a) => a.name.endsWith(".dmg"));
433- return (preferred ?? fallback)?.browser_download_url ?? null;
414+ return assets.find((a) => a.name.endsWith("-arm64.dmg"))?.browser_download_url ?? null;
434415 }
435416 if (platform.os === "linux") {
436417 return assets.find((a) => a.name.endsWith(".AppImage"))?.browser_download_url ?? null;
0 commit comments