更改 Firefox 地址栏的默认搜索引擎

A v*_*ind 15 firefox awesomebar search-engines

我喜欢在 Firefox 的地址栏中输入内容并进行 Google 搜索的功能。但我想知道是否有某种方法可以自定义 Firefox 使用的搜索引擎?

Pyl*_*lsa 20

在 FireFox 中,在地址栏中键入

about:config
Run Code Online (Sandbox Code Playgroud)

并按Enter。现在查找标题为“ keyword.URL”的条目,这是包含在您搜索地址栏时要使用的搜索 URL 的配置键。如果双击该条目,则可以更改该值。

在此处输入图片说明

默认情况下,它应该设置为 google,它使用这个查询 URL:http://www.google.com/search?&q=它可能有点不同,但应该是相似的。

搜索引擎查询 URL 的一些示例:

谷歌: 雅虎: 问: 必应:http://www.google.com/search?&q=
http://search.yahoo.com/search?p=
http://www.ask.com/web?q=
http://www.bing.com/search?q=1

如果您想要其他搜索引擎,但不知道查询 URL,请执行以下操作:

  1. 转到您首选的搜索引擎(例如 Google)

  2. 使用易于识别的关键字(如“HELLOWORLD”)执行搜索

  3. 在您的地址栏中,应该有一个包含您的关键字的 URL。对于谷歌来说,这就像http://www.google.nl/search?q=HELLOWORLD&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:nl:official&client=firefox-a

  4. 现在只需删除=您选择的关键字之前的“ ”之后的所有内容。您的 Google 查询网址为:http://www.google.nl/search?q=

    在此处输入图片说明

  • 此解决方案不再适用于 Firefox (6认同)

Ste*_*nny 6

版本 34.0.5开始,可以通过转到 Options Search

选项
(来源:mozilla.net

它也可以以编程方式更改,尽管这更困难。搜索引擎设置现在保存在配置文件文件夹中的一个名为 search-metadata.json. 例子

{
  "[global]": {
    "current": "Google",
    "hash": "fGiy1O53LgQtereW/4qUSlwFfagTNKGghURIbAFw8wY="
  }
}
Run Code Online (Sandbox Code Playgroud)

可以使用此示例 Bash 脚本创建哈希

profile=default
provider=Google
disclaimer="By modifying this file, I agree that I am doing so only within \
Firefox itself, using official, user-driven search engine selection processes, \
and in a way which does not circumvent user consent. I acknowledge that any \
attempt to change this file from outside of Firefox is a malicious act, and \
will be responded to accordingly."
printf "$profile$provider$disclaimer" | openssl sha256 -binary | base64
Run Code Online (Sandbox Code Playgroud)

此更改已在 Bugzilla 上讨论过可以在源代码中找到 。