Date:  01 Jun 2017 11:08:25 Hong Kong Time

Building a Firefox add-on that responds to / modifies omni-box input?


I'm reading about building Firefox add-ons using the new WebExtensions APIs, and wondering about the limitations of the omnibox api specifically.

It looks like the only way to react to user input in the omnibox is to register a keyword in the manifest.json, which allows the add-on to show a menu and respond to input based on what is typed next. My question is, what if I want to respond to input without requiring a specific prefix, or update the contents of the omnibox? Some examples:

1. Allow the user to change the keyword, or to add their own keywords that the add-on can respond to.

2. If the user types something that looks like an ISBN, or a UPS tracking number, or an email address, or phone number, or some other well-known format, automatically offer results from an appropriate search.

3. Add a feature like Chrome's omnibox, allowing auto-completion of keywords after typing a prefix and hitting tab (or selecting the first result). This would require modifying the contents of the omnibox, as well as reading it.

4. Adding something like "syntax coloring" into the omnibox for more complex inputs.

Is there any way to do any of these with a WebExtension add-on? If not, is there any other way to build add-ons that is not about to be deprecated, that would allow this sort of functionality?