Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda