API to capture and replace address bar input

I’m trying to write my first browser extension.
I’m a complete beginner and I’m mostly doing for fun but also because I miss an extension I was using in the past.

What I’m trying to do is to implement something similar to wealias extension that does not seem to work anymore.

That extension allowed you to create aliases that would have been transformed in the urls according to your configuration

I’ve looked at the documentation and the closest thing I’ve found is: omnibox

The only disadvantage of it is that it would requires to specify a keyword to trigger the extension which would make the process of aliasing less convenient.

Is there another option to capture the input of the address bar and replace it with something else?

I was wrong on the fact that the wealias extension was not working. I simply did not read the description and I was trying to use it as I was used :man_facepalming:

now that I know how it works it is clear to me that omnibox is being used by that extension since you have to type the letter a as keyword to enable the extension.

I’m still interested in knowing if there is an alternative option.
Since anyway I’ll try to create my own version

I don’t think the extension APIs provide a way to monitor address bar input in real time, other than the omnibox API.

Would these be used primarily for static URLs or where you need replacement in the URL?

For static URLs, or simple replacement (entire search string), bookmark keywords are the simplest feature. When you are on a site where you want to assign an alias, right-click the tab (up on the tab bar) and click Bookmark Tab. Firefox should open a variation on the Add Bookmark dialog that has a keyword field. That is where you enter your alias. If you need something in the URL to be replaced by what you type after the keyword, use %s for that variable.

Bookmarks do not support multiple variable replacement, you probably still need an add-on for that.

The idea was to build something a little bit more sophisticated where you can have multiple variables, potentially with predefined options.

Ideally I would like it to behave like a shell prompt and maybe have also some auto completion

But I got another idea. :thinking:
Maybe I don’t need to use the address bar, I could simply use a shortcut combination to show a popup with an input field that you can manipulate