105

Is there a way I can add a custom search URL to the Firefox search bar? e.g. I'd like to provide a URL such as http://blahblah.com?search=%s, where Firefox replaces the %s with the content of the search box.

Both IE and Opera can do this, but I can't figure out how to set it up in Firefox.

14 Answers 14

89

Add keywords to the address bar:

For example, you can set up your browser to search for bread at stackoverflow.com by simply typing so bread into the omnibar.

Do this by right-clicking on the search bar on the website you commonly search. You can do this for the Search field on any website.

Right click on the search bar

Specifically:

  1. Go to the site you want to use to search
  2. Right-Click on the search box you fill out on their page (not Firefox's)
  3. Select "Add a keyword"
  4. Enter the keyword to use when you want to search in that site (eg: "so")
| improve this answer | |
  • 7
    I had no idea that existed... just added 'su' for this site! works great, good tip! – codeLes Jul 17 '09 at 19:40
  • 4
    @Jed Daniels Chrome does have it in the form of custom search engines - Options -> Manage Search Engines – Dan H Jul 3 '11 at 7:12
  • 1
    +1 Wow, to my mind that makes the regular search bar obsolete. – Kazark Jan 11 '12 at 20:23
  • 4
    Is there more updated info on this maybe? Just downloaded latest Firefox on macOS and this doesn't work. :-( – user24601 Mar 16 '18 at 13:39
  • 1
    This is not working now – Giulio Caccin Mar 31 '18 at 19:27
110

I'd like to provide a URL such as "http://blahblah.com?search=%s" where Firefox replaces the %s with the content of the search box.

You can do this with Firefox! Add a bookmark with that URL, where %s is the search query, then simply set a keyword for the bookmark. You can then search using <key> <search term> in the address bar. For example, the bookmark http://www.google.com/search?q=%s with keyword g means you can type g stack overflow in the address bar to search Google for "stack overflow".

Alternatively, go to the site you want to search, right click in the search box and click "Add a keyword for this search".

| improve this answer | |
  • 5
    This is simply awesome! One more reason to love firefox. – qed Oct 20 '13 at 16:49
  • 2
    And what if I don't want a bookmark? What if I only want a search engine without bookmarking it? – Synetech Jul 13 '17 at 18:55
  • 2
    Best answer IMO, as it depends only on URLs, not website-specific search boxes. – ThomasH Mar 2 '18 at 10:25
  • 3
    Apparently putting the %s in the domain part of the URL is now deprecated/broken in FF67 and up. See bugzilla.mozilla.org/show_bug.cgi?id=1553377 – kmarsh Jul 9 '19 at 14:50
  • 2
    Although it's very counter-intuitive, it works (v69.0) – Seu Madruga Sep 30 '19 at 4:56
14

The Add custom search engine extension lets you create a new search engine and customize it.

| improve this answer | |
11

Your best bet is to go to the Mycroft Project and search for an already made search engine plugin.

If you can't find one you can create your own on the submissions page. Full instructions are available.

| improve this answer | |
  • Wow this saved the day for me! This answer should be much higher upvoted. If you want to modify one of your default search engines, you may need to change the plugin name slightly – Pluto Mar 16 '18 at 22:12
  • I was able to add duckduckgo POST to my firefox using the Mycroft search engine. – user674669 Jul 14 '18 at 6:08
6

Ready2Search is also an available free service that helps you do this for any site. It makes search plug-in for Internet Explorer, Firefox, Chrome, and Google Toolbar with great customization options (icons, query parameters, etc.).

Screenshot of Ready2Search

| improve this answer | |
6

The actual, no-bookmark solution for this task:

  1. Open a web page that has a search on it (e.g. MDN: developer.mozilla.org).
  2. In the address bar, find the icon with the three dots (for me, it’s on the right end of the address bar) and click it.

    Screenshot of Firefox’s addressbar showing an icon with three dots.

  3. Click “Add Search Engine”. This adds the web page’s search to the search engines in your preferences.

If you want to set a keyword (e.g. mdn) for this search, follow these steps:

  1. Open the search preferences (or type the following URI in your address bar: about:preferences#search)
  2. In the table under the column for “Keyword”, double-click in order to set your own keyword.
| improve this answer | |
  • 1
    It's sad that FF allows to do that only for web sites which explicitly provide this feature. – Monsignor Oct 7 '19 at 12:16
4

Alternative way for custom search

For an example Google Translate string: https://translate.google.com/m/translate#auto/en/%s so top answer here doesn't work. So I found a workaround with the plugin: add-custom-search-engine

And here we go:

enter image description here

Goes to :

enter image description here

| improve this answer | |
  • 2
    This extension works perfectly to add a custom search engine. It should be a core part of Firefox, not an extension! – wisbucky Sep 24 '19 at 20:49
  • Thanks for this. This works great and is one of the more user-friendly solutions. I'd rather not use the bookmarks solution as I mirror my Firefox bookmarks from another browser. This solution ensures that my custom search engines don't get messed up when I do a mirror or syncing of bookmarks. – galacticninja Jan 15 at 3:12
1

Here is a nice tutorial for Firefox's QuickSearch feature:

Quick search in a nutshell, allows you to turn a typical routined web search process into a command line shortcut. For example, instead of going to wikipedia.com to enter the search terms there, you can use “w mySearchTerm” from Firefox’s address bar.

There are only a few steps you'll have to take:

  1. Right click on the search input field on the web page which provides the search form
  2. Choose "Add a keyword for this search."
  3. Give the custom search a name, you'll later use for searching (example: "mysrch" or a single letter)
  4. Search by inserting "mysrch yourSearchTerm." in Firefox's address bar.
| improve this answer | |
  • That method creates a bookmark. What if I don't want a bookmark? – Synetech Jul 13 '17 at 19:01
1

It's as simple as right clicking in a search field.

The other advantage is that this process creates a bookmark for you. If you use something like XMarks to synchronize your bookmarks, you can access the same search functionality across all synchronised computers.

| improve this answer | |
  • Unfortunately it doesn't seem to play nicely with the builtin Firefox Sync. – sourcejedi Apr 7 '13 at 11:49
1

You can also make complex searches with multiple parameters, and here’s how.

For instance, imagine you have a two field search like this fictitious example:

http:// mymusic.com/search?artist=david+bowie&album=ziggy+stardust

You can make a new mm search like:

javascript:q="%s";if(q.indexOf(",")>0){q=q.split(",");location.href="http://mymusic.com/search?artist="+q[0]+"&album="+q[1]}

(in Firefox it would be a bookmark with keyword mm)

Then you can directly search for: mm david bowie,ziggy startdust (directly in the address bar)

I choose “,” as the separator, but it’s just an example. It’s perfectible, but you get the idea, and anything is possible.

※ Notice that some browsers (including Opera 12) may not execute your JavaScript in a new tab with no preloaded page.

| improve this answer | |
1

Here is how I restored the Twitter search engine for Firefox, which seems to have been removed in Firefox 78 (you could create a search for other websites also based on this answer):

I tested with the Linux version of Firefox (Ubuntu package) but it should work with any operating system by creating the distribution folder / subfolders and search plugin file (https://wiki.mozilla.org/Mobile/Distribution_Files).

In my profile folder .mozilla/firefox/xxx.default/, there was a file search-metadata.json that contained a link to a non-existing file /usr/lib/firefox/distribution/searchplugins/locale/en-US/twitter.xml.

So I created this file with the following content (based on the documentation https://developer.mozilla.org/en-US/docs/Mozilla/Creating_MozSearch_plugins and search plugins already present https://packages.ubuntu.com/focal/amd64/firefox/filelist):

<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>Twitter</ShortName>
  <Description>Twitter Search</Description>
  <InputEncoding>UTF-8</InputEncoding>
  <Image height="16" width="16">data:image/x-icon;base64,
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAA
AAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A
////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD/
//8A////AP///wD///8A////AP///wD///8A////AP///wz///8f////H////x////8Y////B///
/wD///8A////AP///wD///8A////AP///wD///8A////A////yj7789g9tV+ofbVfqH21X6h+N+e
ifz03lf///8o////A////wD///8A////AP///wD///8A////APr37g/PsGCftogQ7r2JAP/bnwD/
7qwA/+6sAP/urAD/9Mtftv357z////8D////AP///wD///8A////AP///wD///8A////AP///w/5
7c5a88VQwu6sAP/urAD/7qwA/+6sAP/xvDDb/fnvP////wD///8A////AP///wD///8A////AP//
/wDz5L5X7bgv2+6sAP/urAD/7qwA/+6sAP/urAD/7qwA//G8MNv///8Y////AP///wD///8A////
AP///wD///8M9NN+n+6wD/PurAD/7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/9Nyegf///wD///8A
////AP///wD///8A+O3PVu6wD/PurAD/7qwA/+6sAP/urAD/7qwA/+6sAP/urAD/7qwA//G8MNv/
//8A////AP///wD///8A////ANasQMXurAD/7qwA/+qpAP/YnAD/1JkA/+6sAP/urAD/7qwA/+6s
AP/urAD/////FP///wD///8A////AP///wDz255+7qwA/9icAP+6ixDuz7Bgn9m8b5TurAD/7qwA
/+6sAP/urAD/7qwA//jkr3j///8M////AP///wD///8A47Y/ysmRAP/PsGCf+vfuD////wDw584w
46QA/+6sAP/urAD/7qwA/9+hAP/orA/z9OrPQv///wD///8A////AMypT7Hhz55g////AP///wD/
//8A////AMOaL9DMlAD/0JYA/8mRAP/FoEC/vpIf4OPQnmL///8A////AP///wD69+4P////AP//
/wD///8A////AP///wD69+4P3ceOcNi/foHhz55g////APr37g/69+4P////AP///wD///8A////
AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A
////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD/
//8A//8AAP//AAD//wAA8P8AAMA/AAD4HwAA8A8AAOAHAADgBwAAwAcAAOAHAADHAwAA3wMAAP/f
AAD//wAA//8AAA==</Image>
  <Url type="text/html" method="get" template="https://twitter.com/search?q={searchTerms}"/>
</OpenSearchDescription>

To get the Base64 of the latest Twitter icon that you can see above, I downloaded https://twitter.com/favicon.ico and used the Linux command base64 favicon.ico.

The following files were present in my profile folder but were not needed anymore so I removed them to avoid potential conflicts (you can backup files in case you want to reuse them): search-metadata.json, search.json, search.json.mozlz4.

The following answers did not work for me but contained useful information:

https://stackoverflow.com/questions/9963256/adding-a-custom-search-engine-to-firefox/10034461#10034461

https://stackoverflow.com/questions/9963256/adding-a-custom-search-engine-to-firefox/40651019#40651019

| improve this answer | |
  • Speaking of search engines, there are many websites which will let the reader store the icon as a data url without knowing about base64. – jpaugh Jul 6 at 15:12
  • 1
    @jpaugh indeed there are other ways to convert the image. The Linux base64 command has the advantage to not depend on an online third-party tool. There should be similar offline tools for other operating systems also. – baptx Jul 7 at 20:37
  • Quite! JavaScript's btoa function might be the most available method. I'm imagining that your instructions are almost capable of being carried out by someone who knows nothing of XML or data urls, which is why I added an alternative. – jpaugh Jul 8 at 20:00
0

Instead of creating it manually you can use a service like Searchplugins.net which provides an online form to generate your custom search plugin.

  1. Search for the word "TEST" in the search engine of your choice and copy/paste the resulting url to the form. eg.

    http://blahblah.com?search=TEST

  2. Fill out remaining info / click "create plugin"

  3. Click "Install" which appears above the form. The plugin will be added to your search bar.

| improve this answer | |
0

A bit late to the party, but for those finding this thread now you can click the search icon in the search bar when on the site you want if it has a green + icon on it.

| improve this answer | |
  • What if it does not show the green + like on a site (e.g., eBay)? – Synetech Jul 13 '17 at 18:59
-2

I believe he's referring to keyword.URL in Firefox's about:config page.

In Firefox's address bar type about:config, then search for keyword.URL and replace its contents with "https://blahblah.com/search?q=", for example.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.