使用 about:config 改善 Firefox 的右键菜单
Making Firefox's right-click not suck with about:config

原始链接: https://joshua.hu/firefox-making-right-click-not-suck

在macOS上全新安装Firefox时,右键菜单会显得非常杂乱,充斥着大量通常不需要的选项——最初多达24行,其中许多是灰色的且无用。作者详细描述了对诸如重复的“AI聊天机器人”选项、晦涩的功能(例如,当不存在干净链接时的“复制干净链接”)以及过去操作的残留(“检查辅助功能属性”)等功能感到沮丧。 文章随后提供了一份详细的指南,通过`about:config`设置来清理此菜单。通过禁用翻译、截图、文本片段、链接预览、OCR等功能,菜单从24项减少到15项。 然而,仍然存在一些持续存在的、不需要的选项(“添加书签链接...”、“另存链接为...”),需要更高级的解决方案:自定义`userChrome.css`文件——这将在未来的文章中讨论。尽管进行了大量清理,完全自定义仍然具有挑战性,一些选项顽固地拒绝删除,除非牺牲拼写检查等有用的功能。

Hacker News新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交登录 让Firefox的右键点击不再糟糕,使用about:config (joshua.hu) 19 分,来自 mmsc 19分钟前 | 隐藏 | 过去 | 收藏 | 3 评论 帮助 wvenable 3分钟前 | 下一个 [–] > 为什么上面所有选项都有…? 不知道。 “…” 约定用于菜单选项打开对话框,而不是立即执行操作。回复 bigthymer 1分钟前 | 上一个 | 下一个 [–] 个人认为,Firefox浏览器的右键点击选项是更有用的右键菜单之一。Apple OS上的那个是过度且无用的更好例子。回复 varun_ch 1分钟前 | 上一个 | 下一个 [–] Firefox能给我们选择的好处真是太好了。也许Chrome或其他浏览器默认情况下有更好的用户体验,但如果你不同意,祝你好运去改变它。 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

On a fresh installation of Firefox on MacOS, right-clicking an image while some text on the page is highlighted (to show as many buttons as possible) looks like so:

To be blunt: holy fucking shit, what the fuck is all of this shit? 24 rows of which 2 are greyed-out (aka: fucking useless), 7 dividers, 2 submenus; because a single row for “Ask an AI Chatbot” wasn’t enough, they just had to make another submenu. Amazing. Also not pictured is the “Search Image with Google Lens” button which seems to be behind some type of segmented rollout, because my real Firefox installation has it, but this fresh version doesn’t.

The “Inspect Accessibility Properties” button was added because I opened the DevTools (Inspector) once. It’s not obvious how to actually disable it ever again. Why am I shown “Copy Clean Link” if there is no clean link (or the link is already clean)? The same goes for “Copy Clean Link to Highlight”. Why can’t I make it so it always defaults to the “clean link” no matter what (and get rid of “Copy Link” completely, instead)? “Ask an AI Chatbot”? No, fuck you.

The rest? Completely useless. Thanks for showing me every feature you’ve ever shipped, with no authoritative selection of what users actually care about – and making it completely non-obvious how to disable the useless shit here.

Enough venting, let’s clean this all up. The following settings in about:config can be used to disable a ton of these useless right-click menu buttons. Set all of these to false.

  • browser.translations.select.enable – Removes the “Translate Selection” button from the right-click menu.
  • screenshots.browser.component.enabled – Disables the built-in Firefox screenshot functionality, which also removes the “Take Screenshot” button.
  • dom.text_fragments.enabled – Disables Text Fragments support, which also removes the “Copy Link to Highlight” button (and disables the auto-focus on URLs that include #:~:text=...).
  • privacy.query_stripping.strip_on_share.enabled – Removes the “Copy Clean Link” / “Copy Link Without Site Tracking” buttons.
  • devtools.accessibility.enabled – Disables the DevTools Accessibility Inspector and removes the “Inspect Accessibility Properties” button.
  • browser.ml.chat.menu – Removes the “Ask an AI Chatbot” button.
  • browser.ml.linkPreview.enabled – Disables Link Previews (and the AI-generated key points inside them), removing “Preview Link” button.
  • dom.text-recognition.enabled – Disables OCR on images, removing the “Copy Text From Image” button.
  • browser.search.visualSearch.featureGate – Disables Visual Search (Google Lens integration) and removes “Search Image with Google Lens” button.
  • extensions.formautofill.addresses.enabled – Disables address autofill and the associated menu/button that sometimes appears in forms.
  • extensions.formautofill.creditCards.enabled – Disables credit card/payment method autofill and removes the associated menu/button that sometimes appears in forms.
  • widget.macos.native-context-menus – Turns off native macOS context menus so Firefox uses its own menus. This removes the “Services” button.
  • print.enabled – Completely disables Firefox’ printing UI and capabilities, which also removes the “Print” and “Print Selection…” buttons (why does this menu have ... after “Print Selection”? The world will, of course, never know.)

How do we look now?

Great, much better, we’re down from 24 buttons to just 15. Here’s what it looks like when you right-click on a page and when you right-click a link:

We still have the following useless buttons though:

  • “Bookmark Link…”
  • “Save Link As…”
  • “Email Image…”
  • “Set Image as Desktop Background…”
  • “Bookmark Page…”

Why do all of the above have ...? No clue. But the real bad news is that we can’t get rid of these things by simply toggling some option in about:config.

We also have these when we right-click in a form:

  • “Check Spelling” (right-clicking in a form)
  • “Languages”

Despite the browser only being used in one language, there is no way to get rid of the “Languages” menu there. It’s possible to get rid of “Check Spelling” by completely disabling spellcheck, but that’s a useful feature for me, so I don’t.

Those remaining useless buttons can only be removed by creating a custom userChrome.css. I’ll cover how to do that in my next post.

联系我们 contact @ memedata.com