prateeknischal / quicksearch

Extension for g! style search but for your favourite sites

Home Page:https://addons.mozilla.org/en-US/firefox/addon/quicksearch/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QuickSearch

https://looka.com/s/82298590

A omnibox extension which implements !g style search redirections implemented in DuckDuckGo but locally.


Table of Contents

QuickSearch in action

A small demonstration with the default aliases.

QuickSearch


How does it work

This extension leverages the omnibox APIs to get invoked upon a trigger word being searched. For this extension, the trigger phrase is !f. Any tokens after this word will be sent to the extension. The extension will then try to find any resolvers using the first token and if found, the remaining tokens will replace the $TERM$ keyword in the template URL. If no resolvers are found, the omnibox is just cleared.

Installation

The extension is available in the Mozilla Add-Ons store at QuickSearch

Usage

Type !f rs tokio and it should open the documentation for the tokio crate on docs.rs. By default there are a few aliases. See the Configuration section.

example

Using as a bookmark tool

You can now use a resolver with no search strings, which would become a bookmarking tool. For example,

{
    "kc": "https://c.xkcd.com/random/comic"
}

In order to use it, !f kc.

Quick access to settings

The extension now supports navigating to the settings using a simple !f @config.

Because the extension is using @ for identifying reserved functions within the extension, it can no longer be used for user-defined resolvers. If they are defined, they won't be accessible.

Configuration

Type !f @config in omnibox, voila! In the Mappings section, you can add your own aliases and then click on save.

As an example, if you wanted to add a Wikipedia resolver, you could add

"w": "https://en.wikipedia.org/wiki/$TERM$"

And press save. After that !f w foobar should be able to search foobar on Wikipedia.

Note: This is useful only for services that have a way to represent searches in HTTP GET.

Settings

Development on the extension

To build your own extension

  1. Clone the repository using
    git clone https://github.com/prateeknischal/quicksearch
    
  2. On your Firefox browser, type about:debugging in the search bar
  3. Click on This Firefox and then Load Temporary Add-on
  4. Once the file explorer opens, navigate to location where the project was cloned and select the manifest.json file and click on open.

And that's it, the plugin should be ready to go!

To build the bundle, Mozilla recommends mozilla/web-ext to build and sign.

Alternatives

This idea has a lot in common with "Adding your custom search engine in Firefox" which already exists for simple searches and only searches.

This project is an attempt to make the omnnibox do a little more!

Contributing

  • Ability to find resolvers from the smallest unique prefix. For example, !f w <term> should invoke the wiki resolver if there are no other resolvers starting with w. Basically a trie based search
  • Add !f @config to open the settings page directly
  • Potentially be useful for any URL manipulation
  • Intelligent resolvers. For example, If I want to look for the docs for io.Writer and I invoke the go resolver, it should be intelligent enough to understand this as a stdlib struct and understand the intent of !f go io.Writer and open the right page. To emulate the behaviour today, you will need to register
"gd": "https://pkg.go.dev/$TERM$"

And search for !f gd io#Writer.

About

Extension for g! style search but for your favourite sites

https://addons.mozilla.org/en-US/firefox/addon/quicksearch/

License:GNU General Public License v3.0


Languages

Language:JavaScript 61.2%Language:HTML 38.8%