As I understand it, this makes use of the 'Smart keywords' feature that's native to Firefox[1]. Take a search URL, add a keyword to it, and you can then use it as 'keyword search_term'. I use this for a few of the sites that I frequent.
What's a pity is some browsers don't promote their native features, which leads most to be unaware of them and then browser makers likely see metrics showing little use of them.
Opera (pre-Chromium) had this feature to begin with, then Firefox (using bookmarks to store the keywords instead). Vivaldi browser retains the Opera style custom search UI and whenever I find myself searching a site enough I just create a nickname for it (eg: to archive the URL directly to archive.org/is, search caniuse.com, among dozens of others).
> What's a pity is some browsers don't promote their native features, which leads most to be unaware of them
Too true. I've wondered for a while what the keyword field in a bookmark was for.
I also found out just the other day that I can add search engines to Firefox[1] if the site supports the OpenSearch API[2]. I didn't know they could be added this way, nor did I know about OpenSearch, if I hadn't have searched for an easier way to search a site I frequent then I would never have known.
Chrome also has this feature: I recently realised this as a Firefox user after being semi-forced to half-switch to Chrome for a good portion of my work.
It's incredibly well hidden though, and the UX is horrific, which I'm convinced must be deliberate.
Yeah, I use this feature constantly. I have e.g. wp to search wikipedia, im to search imdb, di to search dictionary.com.
For anyone else on Firefox, there's no need to go through a search engine or install anything. Just follow the instructions in that link. It'll change your life.
I Think you can put this into single local HTML file and instead of polluting your bookmarks with thousands items make just single keyword bookmark pointing to the HTML and let it handle all the functionality in embedded JavaScript.
The only difference would be one extra space needed for invocation, i.e. instead of `!github test` you'd need to type `! github test`.
I tried this about ten years ago and it seemed to work.
/*
howto:
# place this file somewhere on your disk
# open it in Firefox
# bookmark it, so it's address is like
# file:///c:/web-root/utils/firefox-shell.html
# edit new bookmark: append '?%s' to its URL, so it becomes
# file:///c:/web-root/utils/firefox-shell.html?%s
# set some handy Keyword, eg. '>', '#' or '!' for it
# try it. you should see a list of defined 'bookmarks' (testing only)
# extend, tweak.
# remember that you must use space after the main Keyword: "> command argument1 argument2"
*/
True. My all times favourite is to use it in keyword bookmark for `site:<domain>` so you can go straight to "most relevant page from <domain>" with e.g. `mdn <word>`:
Clever! Thank you for sharing. MDN is specifically the site I most often use this feature for as well. This might be a better substitute, as I have ended up on MSDN a few times in the past when just straight up searching "! mdn <query>".
One of the big advantages of DDG's bangs is that you don't have to re-type/paste the whole search query. Instead, you click the search bar in DDG, type `<space>!g<enter>`. That's vastly simpler and faster than re-typing the query, then `<space>!g<enter>`.
One of the thing that I miss from Chrome from a while ago is the integration with Google. I remember that Chrome would show the query in the omnibar (on mobile anyway) when doing a search on Google. So if you needed to make changes to the query, you can continue doing so within the omnibar.
I think if we can get something like that Chrome feature in Firefox but for DDG (or maybe any search engine?), using Firefox's smart keywords feature would be a lot simpler, and you can bypass the extra request to DDG that it would otherwise take.
> One of the big advantages of DDG's bangs is that you don't have to re-type/paste the whole search query. Instead, you click the search bar in DDG, type `<space>!g<enter>`. That's vastly simpler and faster than re-typing the query, then `<space>!g<enter>`.
At least in Firefox you can also re-enable the search box and just use that. It's even accessible via it's own shortcut (ctrl+k).
Didn't actually think of that. I'd forgotten that was an option, however, I've never liked the separate search box. It just feels like a waste of space. I don't want to think about whether I should press Ctrl+L or Ctrl+K. Half of the time I don't yet know whether I want to search or go to a site.
Chromium based browsers also have a similar feature under the "Manage Search Engines" settings (Took me a while to find this after I switched to Firefox)
I personally use short keywords like "ccc Lego" to search CamelCamelCamel or "e Razer" to search eBay
One thing Firefox does make trickier is that it doesn't make clear you're searching your custom search engine. Chromium recognizes my "ccc", so once I hit space it replaces it with "Search CamelCamelCamel: Lego". Firefox just leaves the bar "ccc Lego", makes it tricky to know if it recognized it.
Current Firefox also has keyword search for installed search engines-- this gives a UI similar to Chrome (where the keyword gets replaced by the search engine name after you hit space) as well as search suggestions for search engines that support it. You can change the keywords in Firefox preferences, under Search Shortcuts on the Search tab.
What's a little unclear about this feature is how you add new search engines to this list-- since there's more functionality here than old-style bookmark keywords, it's not just a matter of right-clicking in a search field or pasting in a URL with a placeholder in it. On supported sites, click the location bar-- at the bottom of the dropdown, you'll see a "This time, search with:" entry with icons for each of your installed search engines, and, if the site supports search, an additional icon with a green "+". Click that to add the search engine, then set your keyword of choice in Preferences.
I have been struggling with bookmark management and discovery. I eventually landed on the following command which allows me to store my bookmarks in my git backed notes. For discoverability this also works surprisingly well due to the file paths containing a lot of searchable context around the bookmark.
Was thinking about something exactly like this the other day. DDG is more useful for using other sites as search engines than it is by itself. Any chance this can be ported to chromium browsers too?
The grand irony is that this first existed in Konqueror (20ish years ago?). This was one of my favorite features in it. Konqueror was a phenomenal browser for the time.
And for those unaware, Konqueror used KHTML, which gave birth to WebKit, which Safari used, and then of course eventually Chrome used until forking it into Blink.
Can anyone remind me what the internal Facebook (sorry, Meta) tool for this is called? Im sure there have been versions of that released as open source.
This may fix the reason I left Firefox. Keyword searches don’t work in the search bar, only the address bar. So when I wanted go to back to Google from DDG, I was forced into an omnibar situation. This wasn’t the first feature cut that ran me off, it was the last. If I have to use an omnibar going forward, I may as will be using my native browser so I set up my keywords in Edge.
I do! I missed the "web command-line" functionality so much I made a self-hosted replacement for it that can be run from a local file[0].
If you add it as your default search provider you can use it directly from the address bar, and at that point it works very similarly to DDG bang syntax (although it does a few other things apart from bookmarks as well).
[1]: https://support.mozilla.org/en-US/kb/how-search-from-address...