I am looking for a way to add a Chrome/Chromium-like behavior to Firefox. Using Chrome you can press Tab when opening a web page using the location bar, and then search the site-specific search engine using OpenSearch. Is there a way to do that in Firefox? It should also be able to automatically add the search engines without the need for manual interaction.
There are 2 possible solutions to add this functionality to Firefox.
Smart Keyword - Built-in Firefox functionality to define a keyword for the search function on a specific site, and execute search in the location bar using
keyword search_stringthen pressing
Enter. Steps below (modified from link).
- Visit the page on the target website that has the search field that you wish to set as a keyword (e.g. http://imdb.com).
- Right-click on the search field and select
Add a Keyword for this Search....
- In the
New Bookmarkdialog, enter an appropriate name for the bookmark (e.g. "IMDB Search"), and create a keyword (e.g. "imdb" or "imdb.com").
- Select any bookmark folder to contain the smart keyword. Click
- To use the created smart bookmark, open a new tab, and enter the keyword and the search string in the Location bar and then press
imdb William Shatner).
InstantFox Quick Search Add-on - An add-on to customize search shortcuts and autocomplete while typing. Manually define a search shortcut, then execute search in the location bar using
shortcut search_stringthen pressing
imdb William Shatner). More information here.
Edit-- I read your above comment, to do this in as few keystrokes as possible could very well be a job for auto-hot-key. Press ctrl+k then you type in what you want to search, then create an autohotkey script to down arrow(x Number of times) and press enter. If you want an arbitrary search term to also be added you can have AHK send site:"custom.url", down arrow, enter, upon a bound key press. (It is perfectly acceptable to have the site:sampleurl.com after the search query in the cases I tried)
The functionality isn't in the location/url bar though. It is one box to the right of that. To search a common site the routine is easier. (These are customizable in about:preferences#search or with the magnifying glass, for example I just added superuser to the options so that I'll be able to now search superuser instead of typing site:superuser.com). Just type the query and press the bound keystroke so that the autohotkey script will:
- send down arrow the appropriate number of times and
https://www.autohotkey.com/docs/commands/Send.htm should get you on the right path and sailing smoothly in no time.
Repeat this with a different number of down arrows and now you have auto searches based on an engine with customizable keystrokes.
This feature is now available in Firefox 83.
From the release notes:
When Firefox autocompletes the URL of one of your search engines, you can now search with that engine directly in the address bar by selecting the shortcut in the address bar results.
Also mentioned in Nightly news:
Search Mode and Tab-to-search were just released in Firefox 83!
What I did to get something like the Chromium/Chrome search behaviour was to set up duckduckgo.com as the default search engine and use its "bang!" syntax.
For example, to search for cat videos in youtube type !yt cat videos. To search in google you would have to type !g. Here are a few more shortcuts: duckduckgo.com bang shortcuts