Answer the question
In order to leave comments, you need to log in
How to bypass the isTrusted:false property in the key event object?
Hello. How can I do a complete simulation of text input using only events without directly changing the value of el.value ?
I'm trying to run
el.dispatchEvent(new KeyboardEvent('keydown', {'key':'h'}));
el.dispatchEvent(new KeyboardEvent('keydown', {'key':'h'}));
el.dispatchEvent(new KeyboardEvent('keypress', {'key':'h'}));
el.dispatchEvent(new InputEvent('beforeinput', {data:'k',inputType: "insertText", bubbles: true, cancelable: true, composed: true, isTrusted: true}));
el.dispatchEvent(new KeyboardEvent('keyup', {'key':'h'}));
chrome.debugger.attach(target, "1.2", function() {
chrome.debugger.sendCommand(target, "Input.dispatchMouseEvent", arguments)
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question