Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
simulating keypress on Input on webpage using chrome.debugger.sendCommand

I'm working on a TamperMonkey script to automate a few things for me on a webpage.

On this webpage there is also an input-field which is giving me some headaches. I can enter values in the field, but it doesn't get validated and the submit button remains disabled.

I can select the input programmatically by using

elmtsInputs[0].select();

after which I can enter the value from my keyboard without any problem.

However if I try:

elmtsInputs[0].value = "0.5";

The value 0.5 appears briefly before it's being reset again to the default 0.0

So there is some sort of validation happening on the input-field that notices that the value wasn't typed. Also when I type in an unauthorized value (basically any value greater than 1) it also shows a validation message to say the value is incorrect. So there is definitely validation happening.

I have tried multiple dispatchEvents but none of them worked. After searching online I came across multiple sources that the problem is related to the isTrusted:false issue where input coming from scripts are not trusted but keyboard input is.

When trying to look if there was any way to bypass this, I found some examples where the use of the Chrome Debugger was used a solution.

chrome.debugger.attach(target, "1.2", function() {
   chrome.debugger.sendCommand(target, "Input.dispatchMouseEvent", arguments)
})

However, I haven't found any useable example on how to implement this.

Can someone shed some light on how this should be implemented? Thank you.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!