Setting up custom site-specific search shortcuts in Firefox
I’ve been thinking about my use of search engines recently, particularly in the light of my disappointment with Kagi.
I am using bookmarks a lot more, and I’ve also been tinkering with archivebox (which will be the subject of a future blogpost, I expect).
I have also experimented with adding custom, site-specific, search shortcuts in Firefox.
This sounds fancier than it is; it’s just direct use of a site’s own search tool, from within Firefox.
What I mean is that, if I want to search on, for example, legislation.gov.uk, I can do so from the URL bar within Firefox, using legislation.gov.uk’s own search tool.
First, I type @leg
, then the name of the legislation I wish to search, and finally I hit “Enter”.
I’ve set up similar search shortcuts for the sites which I most commonly search.
It has taken me a while to get used to it, but that’s just because it is a change from what I did before.
Setting up Firefox to allow custom search shortcuts
By default, Firefox did not let me specify custom search shortcuts in about:preferences#search.
To enable this, I:
- went to
about:config
- entered
browser.urlbar.update2.engineAliasRefresh
- changed its value to
True
by clicking on the “+” icon.
After I did that, in search shortcuts in about:preferences#search, I had a new “Add” button, to add a custom search shortcut.
Adding a custom search shortcut
Adding each individual search shortcut is easy.
I went to the site in question, and carried out a search.
I was looking for where the search term appeared in the URL.
For instance, for legislation.gov.uk, carrying out a search for “test” results in a URL of https://www.legislation.gov.uk/primary+secondary?title=test
.
Replace the search term - test - with “%s”.
This gave me https://www.legislation.gov.uk/primary+secondary?title=%s
.
In about:preferences#search / Search Shortcuts, I clicked “Add”, and then added:
legislation.gov.uk
https://www.legislation.gov.uk/primary+secondary?title=%s
@leg
I clicked “Add Engine”.
And that was it: I had a new custom search shortcut for legislation.gov.uk.
The main nuisance is that I have had to set this up in on each machine I use, as I haven’t got a Firefox sync system working (and I don’t know if this would sync anyway, truth be told).
You can also do a similar thing in Firefox for Android, giving you an extra, custom, search engine option in the URL bar, but without the shortcut.
You may also like:
- In praise of restic (the backup tool)
- Shrinking initrd.img to deal with /boot being too small to upgrade the kernel on Debian
- Increasing the frequency of mqtt messages on power changes in Tasmota using the PowerDelta command
- Fixing iOS Home Assistant 403 error by deleting ip_bans.yaml
- Attempting to stop Microsoft users sending 'reactions' to email from me by adding a postfix header
- Fixing a Chromebook which was showing scam notifications about viruses
- Adding Open Graph meta tags to my hugo static site's theme for nicer fedi link previews
- Working out why Home Assistant on Android had ceased to get my phone's location
- Six months with the Xreal Air 2 Pro glasses
- I don't have, or want, comments on my blog
- How often do I access my own systems?
- Kobo Mini notes
- I didn't go to EMF camp
- Reviving a Kobo Aura HD that would not turn on
- Replacing the battery and increasing the storage on a Kobo Clara HD eReader