Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

112
Visualizações
Chrome Extension - input auto-changing, not dispatching the change event

I have an iframe that I'm trying to make auto filling by chrome extension. The value is changed well, but the app doesn't see the values, and I need to type it again for it to affect the form.

After googling, I do all the below code tries and more.

What else can I do?

function func3() {
    // setTimeout(function () {
    //
    // }, )
    let elId3 = "social-id-field";
    let input3 = document.getElementById(elId3);
    if (input3 != null) {

        //also tried that :
        // let ev = document.createEvent('Events');
        // ev.initEvent('keypress', true, true);
        // ev.keyCode = 13;
        // ev.which = 13;
        // ev.charCode = 13;
        // ev.key = 'Enter';
        // ev.code = 'Enter';
        input3.value = "123456789";
        // input3.dispatchEvent(ev);

        // let event = new Event('input', {bubbles: true});
        input3.dispatchEvent(new Event('change'));


    }


}

Manifest:

...    
{
          "matches": [ "https://*.hf.paymeservice.com/service/field/*"],
          "all_frames": true,
          "css": ["style.css"],
          "js": ["jquery-3.6.0.min.js","factory54-payment.js"]
        }
        ...

this is the page

Update:

Until I press enter inside the input it's won't work. Also, I see that it's happening only on this input.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda