如何从DuckDuckGo上使用Firefox浏览器的搜索中移除`t=canonical`?

在Ubuntu 14.04中,当我使用Firefox的地址栏或搜索栏进行搜索时,系统总是会在我的搜索中添加"t=canonical"。因此完整的字符串变成了"https://duckduckgo.com/?q=cat+cooking+salmon&t=canonical"。
然而,如果我直接在搜索引擎中进行相同的搜索,即输入搜索引擎名称并在呈现的搜索框中进行搜索,这种情况就不会发生。在这种情况下,字符串为"https://duckduckgo.com/?q=cat+cooking+salmon"。

Search made directly by going to DuckDuckGo

如何阻止Ubuntu/Firefox在我的搜索查询中添加"t=canonical"?而且,为什么一开始就有这种行为呢?

4但等等!情况会变得更好!这是在Mac上使用Chrome拍摄的屏幕截图。https://i.imgur.com/WbW2d1M.png - jrg
1所以它在整个生态系统中遭受感染,并从浏览器到浏览器,从平台到平台进行传播。 - jrg
5请注意,即使您从查询字符串中删除此信息,您的浏览器仍然在用户代理字符串中广播"Ubuntu"。 - Oli
2在“纯粹”的开放源代码中赚钱很困难。为什么不以这种小方式支持Ubuntu Linux呢? - lnostdal
3@lnostdal: "在“纯粹”的开源领域赚钱真的很难。为什么不用这种小方式来支持Ubuntu Linux呢?" --- 隐私,尽管我更感兴趣的是了解如何和为什么。 - Daniel
@Oli 只是提醒一下,Firefox 不再这样做了,也许 Chrome 还会。FF(Ubuntu)的用户代理标头:Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0 - chefarov
@chefarov 相当确信你要么用的是Windows,要么使用了类似用户代理切换器的工具。我的Firefox仍然会广播我正在使用Ubuntu和Linux。 - Oli
6个回答

&t=

Through partnerships with developers and companies, DuckDuckGo has been integrated into many applications. In these partnerships, a portion of DuckDuckGo's advertising revenue is sometimes shared back. To assign advertising revenue and collect anonymous aggregate usage information, developers add a unique "&t=" parameter to searches made through their applications.

If you want to remove it, edit the file:

/usr/lib/firefox/distribution/searchplugins/locale/*language-here*

Edit all the languages just to be sure.

enter image description here

编辑 20.04

  1. 打开Firefox,导航至偏好设置-->搜索,并删除预安装的DuckDuckGo搜索引擎
  2. 从Firefox Add-ons目录中下载新的搜索引擎。在首选项中选择此作为默认搜索引擎。此后,在地址栏中不再插入字符串&t=canonical。在Komalleana Byzantis的帮助下。

以下是之前和之后的图片:

enter image description here

enter image description here

来源:DuckDuckGo论坛


在注释掉包含<!--<Param name="t" value="canonical"/>-->的那一行并重新启动Firefox之后,t=canonical不再显示。同时也对链接到DDG论坛表示赞赏。 - Daniel
1更新后,文件恢复为原始内容,所以我不得不重复这些步骤。 - Daniel
3所以这意味着收入是由Canonical(Ubuntu的母公司)获得,而不是FF最初发起搜索的吗? - asgs
无法在20.04 LTS上使用Firefox 75+。 - N0rbert
@N0rbert,请查看我在20.04版本上的编辑方式。 - Mitch
以上两种方法在20.04FF 77中都无法正常工作。如果你在搜索栏中访问google.com或者duckduckgo.com进行搜索,client=ubuntu不会被包含在其中。但是,如果你直接在地址栏中进行搜索,则会包含该参数。 - chefarov

阅读来自apt-cache show xul-ext-ubufox的输出。这是一个部分引用:
Package: xul-ext-ubufox
Priority: optional
Section: web
Installed-Size: 378
Maintainer: Ubuntu Mozilla Team <ubuntu-mozillateam@lists.ubuntu.com>
Architecture: all
Source: ubufox
Version: 2.8-0ubuntu1
Replaces: ubufox (<< 0.9~rc2-0ubuntu3)
Provides: firefox-ubufox, ubufox
Depends: aptdaemon, libglib2.0-0 (>= 2.26)
Recommends: firefox (>= 9.0)
...
Description-en: Ubuntu-specific configuration defaults and apt support for Firefox
 Adds Ubuntu-specific modifications to Firefox.
 .
 Integrates the browser with Ubuntu to:
  * Enable searching for missing plugins from Ubuntu software catalog
  * Add the following options to the Help menu
    - Get help on-line
    - Help translating Firefox
    - Ubuntu Release Notes
  * Set homepage to Ubuntu Start Page
  * Display a restart notification after upgrading Firefox
  * Add ask.com to the search engines.
 .
You can uninstall this if you prefer to use a pristine Firefox install.
Enhances: firefox
Homepage: https://launchpad.net/ubufox

注意倒数第三行。
至于为什么,Canonical可能会赚取一些收入,但这只是猜测。

1这对于20.04 LTS来说并不适用 - 这个软件包实际上没有任何有用的内容,因为XUL已被移除。 - N0rbert

我正在使用Xubuntu 16.04.4(64位)上的Firefox 60.0.1。我遇到了你面临的同样问题。Mitch提供的选择答案对我没有起作用。相反,我通过以下步骤解决了这个问题:
  1. 打开Firefox,导航到首选项->搜索,并删除预安装的DuckDuckGo搜索引擎
  2. 从Firefox附加组件目录中重新下载搜索引擎;可以在这里找到
  3. 在首选项中将其设置为默认搜索引擎
此后,字符串“&t=canonical”不再自动插入我的地址栏搜索中。
我无法告诉你为什么一开始会出现这种行为。

好的,这是我成功完成的方法。
  1. 使用以下命令从系统中彻底删除Firefox:

    sudo apt-get purge firefox
    

    然后从Mozilla的官方网站下载并安装到/opt/firefox目录下。

  2. 通过以下命令创建一个符号链接:

    sudo ln -s /opt/firefox/firefox /usr/bin/firefox
    
  3. 将新创建的something.release文件夹替换掉~/.mozilla/firefox目录下的旧配置文件夹,确保两者的名称完全相同(先将旧的配置文件夹重命名为新的文件夹名称,然后再删除新的文件夹)。

  4. 创建一个新的应用程序快捷方式。

所有我之前的用户信息和设置都被保留下来。

由于以上答案在新版Firefox上无效。 因此,我建议从官方网站下载Firefox并创建符号链接。
sudo ln -s /path_to_downloaded_firefox_executable_file /usr/bin/firefox

要从Firefox搜索字符串中删除“canonical”和其他非标准的Ubuntu内容,请删除“/usr/lib/firefox/distribution/searchplugins/locale/”目录中的所有内容。