中文 / English README 目标:在 macOS 上提供一套可分享、可复用的 Firefox 隐私/安全配置框架:
user-overrides.js:基于 arkenfoxuser.js的偏好覆盖(prefs overrides)userChrome.css:浏览器 UI(顶部工具栏)自动隐藏/显示- 适配:macOS 桌面 Firefox(不适用于 Firefox iOS)
本仓库包含两个核心文件:
-
user-overrides.js用于覆盖(override)arkenfoxuser.js中的偏好项(prefs)。配合 arkenfox 的updater.sh,可以在每次更新 arkenfoxuser.js时自动把本文件追加到最终user.js末尾,从而实现“升级不丢配置”。 -
chrome/userChrome.css用于修改 Firefox 浏览器自身 UI(不是网页 CSS)。当前实现目标是:- 隐藏标签栏(Tabs Toolbar)/隐藏标题栏(Titlebar)
- 地址栏(nav-bar)默认隐藏,鼠标移动到顶部触发区或键盘交互时再显示
- 在 macOS 全屏场景下,通过
padding-top避免工具栏被系统菜单栏遮挡
This repository provides two main files:
-
user-overrides.jsPreference overrides intended to be appended after arkenfoxuser.jsviaupdater.sh, so updates do not wipe personal settings. -
chrome/userChrome.cssFirefox UI customization (not webpage CSS). Current goal: hide tab bar/title bar, and auto-hide the address bar toolbar with hover/keyboard reveal, with macOS fullscreen menu bar considerations.
- ✅ Firefox Desktop on macOS
- ✅ arkenfox
user.jsworkflow (withupdater.sh+prefsCleaner.sh) - ❌ Firefox iOS (iOS 版 Firefox 使用 WKWebView/WebKit,且不支持桌面扩展体系;桌面
user.js机制无法原样迁移) ⚠️ Tor Browser:该项目不以 Tor Browser 为目标环境
.
├── README.md
├── LICENSE
├── user-overrides.js
└── chrome/
└── userChrome.css
-
Firefox 启动时会读取 profile 根目录的
user.js,并把偏好写入prefs.js(运行时文件)。 -
arkenfox 的推荐维护方式是:不要手动改 arkenfox
user.js,而是把个人改动写到user-overrides.js。 -
updater.sh会下载最新版 arkenfoxuser.js,并把user-overrides.js追加到末尾。由于“同名 pref 以最后出现为准”,因此 overrides 会覆盖 arkenfox 的默认值。 -
Firefox reads
user.json startup and writes preferences intoprefs.js. -
arkenfox recommends not editing
user.jsdirectly; instead keep personal changes inuser-overrides.js. -
updater.shdownloads the latest arkenfoxuser.jsand appendsuser-overrides.jsat the end. Since prefs are last-write-wins, overrides take precedence.
Firefox 只有在以下条件成立时才会加载 userChrome.css:
- profile 中存在
chrome/userChrome.css toolkit.legacyUserProfileCustomizations.stylesheets = true
Firefox loads userChrome.css only if:
chrome/userChrome.cssexists in the profiletoolkit.legacyUserProfileCustomizations.stylesheets = true
-
找到当前 profile 路径
- Firefox 地址栏输入:
about:profiles - 在 “Default Profile: yes” 的那一栏打开 Root Directory
- Firefox 地址栏输入:
-
将本仓库的文件复制到 profile
user-overrides.js→ profile 根目录chrome/userChrome.css→ profile 的chrome/目录(没有就新建)
-
将 arkenfox 的脚本放入 profile 根目录(如果使用自动更新)
updater.shprefsCleaner.sh然后执行(脚本是 bash;在 fish/zsh 下通过./updater.sh执行即可;避免source):
./updater.sh ./prefsCleaner.sh
-
重启 Firefox
在 user-overrides.js 中将:
network.trr.mode = 5表示关闭 Firefox 内置 DoH/TRR,使 Firefox 回退到系统 DNS。
在启用 Stash TUN + DNS hijack 的前提下,DNS 查询由 Stash 处理,并由 Stash 决定上游 DoH。
Setting network.trr.mode = 5 disables Firefox TRR/DoH and falls back to system DNS. With Stash TUN + DNS hijack enabled, DNS is handled by Stash.
-
privacy.resistFingerprinting = true:启用 Firefox 内置反指纹机制(强约束/统一多个可观测指标) -
privacy.resistFingerprinting.letterboxing = true:对窗口内尺寸做分级对齐,降低窗口尺寸指纹可用性 -
privacy.resistFingerprinting = trueenables strong built-in anti-fingerprinting. -
letterboxing = truerounds inner window sizes to reduce size-based fingerprinting.
-
media.peerconnection.enabled = false:禁用 WebRTC -
webgl.disabled = true:禁用 WebGL -
Disables WebRTC and WebGL, reducing related attack surface and fingerprinting vectors.
当前 userChrome.css 采用的思路是:
- 通过对
#nav-bar设置负margin-top,将导航栏向上“收起” - 保留一个很薄的可 hover “触发条”(
--uc-nav-reveal) - 当 hover/focus/popup 条件满足时,把
margin-top置回 0,从而显示 nav-bar - 全屏时增加
padding-top以避免 nav-bar 被 macOS 菜单栏遮挡
The CSS hides #nav-bar by applying a negative margin-top and leaves a small reveal strip for hover. On hover/focus/popup triggers, it resets the margin to 0 to reveal the toolbar. In fullscreen, padding is added to avoid the macOS menu bar overlay.
-
Google 搜索页在某些输入框焦点/切换操作下可能出现滚动异常(环境依赖性较强)。 现象在其他站点(例如 DuckDuckGo/GitHub)不一定复现。
-
Google Search may exhibit scroll quirks depending on focus/space switching and extension/script-blocking behavior; other sites may not reproduce it.
MIT License. See LICENSE.