is there a way to simulate a raw Keyboard input in javascript, so that it is possible to f.e. fill in text on your webpage via a web extension?
My plan is, to load in a web extension (firefox) that f.e. writes a word into the searchbar of youtube.
All that I could find is the Keyboard events eg:
var e = new KeyboardEvent('keydown',{'keyCode':32,'which':32});
document.dispatchEvent(e);
Sadly this only triggers a keydown event, so that I can start and stop videos but cant type into the search bar text field.
Any help is really appriciated!
Thanks in advance.