Probably you can inject your js and add an input event in the body of the page.
Firefox
A place to discuss the news and latest developments on the open-source browser Firefox
To detect two keystrokes closely followed, you can use EventListener
s for the onkeyup
/onkeydown
event. In combination with a variable that determines if the key was already pressed within the last 100 ms and a setTimeout
call that resets that variable after 100 ms, it should be fairly easy to accomplish.
If you just need to intercept the keypresses in webpages then you can inject a content script and handle these. However there is no way with the new WebExtensions API to intercept browser chrome events.
Additionally there is no way to delay events. So if you want to suppress both shift presses you will struggle to do that. If you are ok to let the first one go through suppressing the second one is trivial.
Look up userscripts. They are a not officially supported feature with bad documentation. It allows you to write javascript code that affects internal state of the browser.
There are 3rd party pages with useful pieces of information. Userchrome styling (and in turn also things called firefoxcss) and the old XUL addon API docs may be helpful.
One question though. Do you have prior programming experience? Even hobby level.
I'd you don't, maybe this is not the best opportunity to learn it. You want to learn that with things that are documented, there are plenty of things like that.