Search the web faster with in-browser shortcuts
To install this extension, all you have to do is set your default browser engine to the following url:
https://search-shortcuts.alfie-ranstead.workers.dev/search?q={%s}
Where {%s}
is the search query and should be replaced with whatever your browser uses to represent the search query.
In Firefox, this is %s
, so the url would be:
https://search-shortcuts.alfie-ranstead.workers.dev/search?q=%s
There are two types of shortcuts, standard and account based.
Standard shortcuts can be used by typing !
followed by the shortcut name, then if you want to search for something,
type a space and then your search query.
For example to go to the youtube home page you could type !yt
or !youtube
, and to search for a video you could type !yt cats
.
Account shortcuts try to take you to an account on the website referenced by the shortcut, whilst also allowing you
to navigate to a specific page on the website. To use an account shortcut type @
followed by the shortcut name,
then if you want to search for something, type a space and then your search query.
For example if you wanted to go to my github profile you could type @gh alfieran
, and if you wanted to go to this repository you could
type @gh alfieran/search-shortcuts
.
Not all websites that have standard shortcuts have account shortcuts, but if you want to add one, you can do so by creating a pull request.
To contribute to this project you will need to first complete the setup steps below:
- Clone this repository.
- Run
yarn install
ornpm install
to install all dependencies.
Now you can start developing as according to the specific section you are contributing to.
- Head to the
/src/shortcuts.ts
file, the file also contains instructions on how to add a shortcut within this file but I will also explain it here. - Add your shortcut(s) aliases to the relevant array(s) starting on line 10, these arrays are split up by genre so please add your shortcut to the correct array.
- Now add your actual shortcut urls to the
shortcuts
object below the arrays, they key should be your shortcut name/aliases and the value should follow the typeShortcutData
which is defined at the top of the file. (This const should be typed, so if you are using an IDE it should tell you what type the value should be). - Once you have added your shortcut, please test it locally using
yarn dev
ornpm run dev
and make sure it works as expected, you should be able to test the search by going tolocalhost:8787/search?q=your+search+query
. - Once you are happy with your shortcut, please create a pull request that begins with the tag
add-shortcut-
and some relevant additional detail and I will review it as soon as possible.
To add a new engine, please follow the steps below:
- Head to the
/src/engines.ts
file, the file also contains instructions on how to add an engine within this file but I will also explain it here. - Add the engine name/alias to the
availableEngines
array on line 10. - Now add your actual engine urls to the
engines
object below the array, the key should be your engine name/alias and the value should follow the typeEngineData
defined at the top of the file. - Once you have added your engine, please test it locally using
yarn dev
ornpm run dev
and make sure it works as expected, you should be able to test the search by going tolocalhost:8787/search?q=test&e=your+engine+name
. - Once you are happy with your engine, please create a pull request that begins with the tag
add-engine-
and some relevant additional detail and I will review it as soon as possible.
If you are fixing a bug or making another change, please create a pull request that begins with the tag fix-
or change-
and ensure you test your changes locally using yarn dev
or npm run dev
and make sure it works as expected.
This project is licensed under the MIT license, see the LICENSE file for more details.
This project was created by Alfie Ranstead.
Inspired by Alistair Smith's Searchy which I used to use but grew frustrated with the fact it doesn't work with multiple shortcut types under the same alias (non-query shortcuts, query shortcuts and account shortcuts).