Rated 1 out of 5 stars
There is already one extension for that job: Zombie Keys (https://addons.mozilla.org/ru/firefox/addon/zombie-keys/).This review is for a previous version of the add-on (0.3.1-signed.1-signed).
Thank you for the recommendation. I have been searching for an addon that would do this for years (I will suggest some key words for the Zombie addon author to include in their description).
A significant advantage of Zombie is it works in the location bar and search box (not just web pages). One minor disadvantage is a keyboard conflict with Firefox tab groups and CTRL+` (ACCENT GRAVE), the letter.