Adding A Custom Search Engine To Firefox

42,476

Solution 1

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.

Solution 2

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.

Solution 3

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.

Solution 4

The easiest way to add new search engines is via the "Add to Search Bar" add-on, simply right click on the search form on the webpage you want to add, then "Add to Search Bar" and it will show up in the Search Bar:

Solution 5

I came here to add tldr-pages as a custom search, looking for a way how to do that.

Turns out, that there was a very simple way: In Firefox, next to the URL-bar, there is a search-bar with a magnifying-glass. If that magnifying-glass has a PLUS on it, the page you are looking at offers its own openSearch.xml-file.

  • hit the search-box
  • a pop-up opens
  • find the line that says "Add" at the bottom and
  • click it

That is how I solved my initial problem and maybe it solves yours, too.

Share:
42,476

Related videos on Youtube

Nusrat Nuriyev
Author by

Nusrat Nuriyev

Updated on February 21, 2022

Comments

  • Nusrat Nuriyev
    Nusrat Nuriyev 9 months

    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?

  • Nathan Stretch
    Nathan Stretch about 9 years
    My experience was that step 3) was not necessary, but what was necessary to have the new xml file recognized was to delete search.json and search.sqlite in %APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default
  • Lambart
    Lambart over 8 years
    When trying to add a plugin from that site to Firefox, I get a popup saying "Your browser does not support OpenSearch search plugins", which is clearly not true (and the site itself says Firefox does). Even if it worked, I have to say: that is one awful web site.
  • Lambart
    Lambart over 8 years
    Firefox 30.0 (Ubuntu) -- I didn't have to do step 3 either. I also didn't need to delete search.json and I saw no search.sqlite.
  • phuclv
    phuclv over 6 years
    somehow this works great on my work computer but not on my personal PC :(
  • Christian J
    Christian J about 5 years
    But what is the right place?
  • johndodo
    johndodo almost 5 years
    This addon is unfortunately no longer supported (FF 57). Great one otherwise.
  • jpaugh
    jpaugh almost 5 years
    FWIW, OpenSearch works by providing an XML file in this format, and linking it with rel="search". For example, on tldr-pages, we see: <link title="Search" rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml">, which adds this file.
  • jpaugh
    jpaugh almost 5 years
    BTW, I got this to work in Ubuntu (Linux), but not Windows. Not sure what's going on, but it might be one of those custom modifications that Canonical makes to Firefox for Ubuntu.
  • jpaugh
    jpaugh almost 5 years
    This only works up to FF 45. Here's an alternative way to do it (which works even if the searchplugins folder does not exist); however, it does not work for FF Quantum.
  • jpaugh
    jpaugh almost 5 years
    This still works with FF Quantum! You can search existing entries (submitted by other users) here.
  • Finch_Powers
    Finch_Powers over 4 years
    @jpaugh this should be added as an official answer.
  • jpaugh
    jpaugh over 4 years
    @Finch_Powers Thanks! Though, I didn't really answer the OP's question, but simply explained Chris' answer in more depth.
  • Dave Land
    Dave Land over 4 years
    Con: No longer works with Firefox Quantum
  • RJVB
    RJVB about 4 years
    This works great (no restarting required) and could (should...) be cross-browser!
  • RJVB
    RJVB about 4 years
    Nice way to get the official search formula added automagically, but it would be even nicer if the add option could be accessed without showing the dedicated search widget (which takes up unnecessary place). But maybe it's possible and I overlooked it?
  • Peeyush Kushwaha
    Peeyush Kushwaha almost 4 years
    This is amazing. They claim to have 23k websites. Best part: it worked in just a few clicks.
  • baptx
    baptx over 2 years
    This did not work for me with Firefox 78 but I found another solution: superuser.com/questions/7327/…
  • baptx
    baptx over 2 years
    @jpaugh Here is a solution that works with Firefox 78 (on Linux at least): superuser.com/questions/7327/…
  • jpaugh
    jpaugh over 2 years
    This seems more like a comment than an answer. If the question weren't already closed, I'd flag it.
  • gargoylebident
    gargoylebident 10 months
    How do I "install the search engine directly in the browser?"