You can use Firefox Developer Edition and make your own addon. It isn't exactly straightforward, especially the "communicate with external software" part (e.g. in Windows you need to put some entry in the registry to let Firefox know what program you need to communicate with) and communication has to be via JSON which in practice means you need to write some sort of proxy app.
But it is possible. I have made my own little addon that calls yt-dlp (previously youtube-dl) with the current URL to save videos from YouTube and other supported places (e.g. Reddit) with a single click. The addon communicates with a Python program to send it the current page's URL which in turn just changes to a predefined directory (where downloaded videos are stored) and calls yt-dlp with that URL.
I was a bit hesitant at first to bother with all that but eventually i decided that it is "my browser" so i should be able to do whatever i want with it and certainly adding a button to call a program with the current URL should be more than possible.
The downside is that Developer Edition updates way more often than regular Firefox which in theory might break stuff but personally i never had an issue with it.