Adding A Custom Search Engine To Firefox

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.


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.


If you are just trying 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 give it a keyword. The subsequent search terms will fill into the placeholder. For an example that searches Stack Overflow, put these fields into a "New Bookmark"

Name Search Stack Overflow
Location https://stackoverflow.com/search?q=%s
Tags development (your relevant tags)
Keyword so
Description

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

If you have also added search engines in Chrome, you will recognize the same %s placeholder that is used in chrome://settings/searchEngines. I do not know, but it may be that Chrome also uses bookmarks like Firefox under the hood.

Tags:

Firefox