Adding A Custom Search Engine To Firefox
Solution 1
Here are the steps:
Need to create an xml file which will contain information about search engine like ShortName, Description, Url etc. (Example)
-
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" -
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
Locationhttps://stackoverflow.com/search?q=%s
Tagsdevelopment(your relevant tags)
Keywordso
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.
Related videos on Youtube
Nusrat Nuriyev
Updated on February 21, 2022Comments
-
Nusrat Nuriyev 9 monthsI need to add a custom search engine to Firefox. I have a name and a search url.
What options should I change in
%APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\prefs.jsfile?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
Should I modify
%APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\search.sqlitesqlite database file?
-
wisbucky about 3 yearsSee related question at SuperUser which is not closed: superuser.com/questions/7327/…
-
Nathan Stretch about 9 yearsMy 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 over 8 yearsWhen 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 over 8 yearsFirefox 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 over 6 yearssomehow this works great on my work computer but not on my personal PC :( -
Christian J about 5 yearsBut what is the right place? -
johndodo almost 5 yearsThis addon is unfortunately no longer supported (FF 57). Great one otherwise. -
jpaugh almost 5 yearsFWIW, OpenSearch works by providing an XML file in this format, and linking it withrel="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 almost 5 yearsBTW, 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 almost 5 yearsThis 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 almost 5 yearsThis still works with FF Quantum! You can search existing entries (submitted by other users) here. -
Finch_Powers over 4 years@jpaugh this should be added as an official answer. -
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 over 4 yearsCon:No longer works with Firefox Quantum -
RJVB about 4 yearsThis works great (no restarting required) and could (should...) be cross-browser! -
RJVB about 4 yearsNice 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 almost 4 yearsThis is amazing. They claim to have 23k websites. Best part: it worked in just a few clicks. -
baptx over 2 yearsThis did not work for me with Firefox 78 but I found another solution: superuser.com/questions/7327/… -
baptx over 2 years@jpaugh Here is a solution that works with Firefox 78 (on Linux at least): superuser.com/questions/7327/… -
jpaugh over 2 yearsThis seems more like a comment than an answer. If the question weren't already closed, I'd flag it. -
gargoylebident 10 monthsHow do I "install the search engine directly in the browser?"