Android visitors are offered the Linux .deb on cap.so's homepage and download page

未关闭 适合新手
#3,677 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@patrickballard 已经在做这个了。

开始于 2026年11月3日。

  • #3678 来自 @patrickballard —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
nextjs, react, typescript
领域
frontend

调研方向

从 apps/web/hooks/useDetectPlatform.ts 开始,这里会把任何包含 "Linux" 的 user agent 归类为桌面版 Linux。然后检查首页按钮和下载页面,它们都读取这个 hook 的结果,并链接到 /download/linux-deb。完成的标准是:像 Pixel 8 示例那样的 Android user agent 不再被识别为 Linux,而 iPhone 和无法识别的 user agent 保持现有的默认值。在 Chrome 开发者工具中将 user agent 覆盖为 Android 进行验证。

由索引模型根据 Issue 内容生成。

描述

Description

useDetectPlatform (apps/web/hooks/useDetectPlatform.ts) treats any user agent containing "Linux" as desktop Linux. Android browsers include "Linux" in theirs (Mozilla/5.0 (Linux; Android 14; Pixel 8) ...), so on an Android phone or tablet:

  • the homepage's main button reads "Download free for Linux" and links to /download/linux-deb;
  • the download page's main button has the Linux logo, links to /download/linux-deb, and is captioned "Linux x86_64 • .deb, AppImage, RPM and Arch available".

Tapping either downloads the desktop Linux package to the phone. iPhones and other unrecognised devices get the site's default instead: the macOS app on the homepage, and a generic "Download Cap" on the download page.

Reproduction
  1. Open cap.so in Chrome on an Android phone, or in desktop Chrome with device emulation set to an Android device such as a Pixel 8.
  2. The homepage's main button reads "Download free for Linux".
  3. On cap.so/download, the main button has the Linux logo and links to /download/linux-deb.
cap.so homepage in Chrome's Android emulation (Pixel 8): the main button reads Download free for Linux
Expected

Android isn't treated as desktop Linux, so it isn't offered the Linux package.

主要语言
Rust
星标
24.2k
派生
2.2k
平均合并
1 天 9 小时
30 天内合并 PR
731

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CapSoftware/Cap 的其他 Issue

查看 CapSoftware/Cap 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。