Adding A Custom Search Engine To Firefox [closed]

2020-02-16 08:15发布

I need to add a custom search engine to Firefox. I have a name and a search url.

  1. What options should I change in %APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\prefs.js file?

  2. Do I need to create a distinct xml file for new search engine in one of these folders?

    • %APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\searchplugins

    • %PROGRAM_FILES%\Mozilla Firefox\searchplugins

  3. Should I modify %APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\search.sqlite sqlite database file?

标签: firefox
8条回答
你好瞎i
2楼-- · 2020-02-16 08:51

You can also use this opensearch Mycroft Project

It has everything already created just enter the values into textbox and and you have the XML code; and you can install the search engine directly in the browser from there.

You can also submit your website search engine, and search for (and use) a search engine submitted by another user.

查看更多
手持菜刀,她持情操
3楼-- · 2020-02-16 08:53

If your objective is just to be able to search a certain site from the address bar, you do not have to create any OpenSearch XML.

You can add a bookmark with %s as a placeholder, and add a keyword. The subsequent search terms will fill into the placeholder. For example, put these fields into a "New Bookmark" to search Stack Overflow:

Name Search Stack Overflow
Location https://stackoverflow.com/search?q=%s
Tags
Keyword so
Description

To perform a search, type so How to exit Vim into the address bar and hit enter.

查看更多
beautiful°
4楼-- · 2020-02-16 09:03

Make sure that your & is escaped as &
Firefox will NOT activate the search engine that are broken in format
Check https://developer.mozilla.org/en-US/Add-ons/Creating_OpenSearch_plugins_for_Firefox#Troubleshooting_Tips

Just put a right xml file in right place,it will take effect after restarting firefox

查看更多
疯言疯语
5楼-- · 2020-02-16 09:03

Give this a try.

http://www.investintech.com/resources/blog/archives/5263-address-bar-search-engine.html

Using Iceweasel (Linux), should work for Firefox too. Tried it for about 30 sites that i had with Chrome/Chromium.

Pro:

Works!

Cons:

Too much manual work.
查看更多
啃猪蹄的小仙女
6楼-- · 2020-02-16 09:11

Here are the steps:

  1. Need to create an xml file which will contain information about search engine like ShortName, Description, Url etc. (Example)

  2. Give a name to that xml file and put it here

    "%APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\searchplugins"
    

    or here

    "%PROGRAM_FILES%\Mozilla Firefox\searchplugins"
    
  3. Modifying firefox preferences file "%APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\prefs.js"

    Simply add/modify this line:

    user_pref("browser.search.selectedEngine", "engine_name");
    

No need to modify sqlite database file manually. New search engine will be added automatically after restarting Firefox.

查看更多
Animai°情兽
7楼-- · 2020-02-16 09:13

It helped for me. (Firefox v50)

  1. Close Firefox;
  2. Delete in profile of Firefox: search.json, search.json.mozlz4
  3. Copy your OpenSearch in searchplugins folder;
  4. Add an entry in search-metadata.json;

    "[profile]/your-opensearch.xml": {
      "alias": "your-opensearch",
      "order": 25
    }
    
查看更多
登录 后发表回答