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

197
Visualizações
How to create a Chrome Extension to change value of a javascript variable?

I have this page that wait 100 seconds and then writes "finish" on a button:

<html>
<head>
</head>
<body>
<form action="" name="submitform" method="POST">
<input name="submitbutton" type="submit" value="Submit">
</form>
<script language="JavaScript">
var time;
var timer;
time = 100;
timer = setTimeout("countdown()", 1000);

function countdown() {
    time--;
    document.submitform.submitbutton.value = "Submit (remaining " + time + " seconds)";
    if (time > 0) {
        timer = setTimeout("countdown()", 1000);
    } else {
        document.submitform.submitbutton.value = "finish";
    }
}
</script>
</body>
</html>

if I click on f12 I can change the "time" value with the Chrome console like:

Time=1000

I want to create a Chrome extension that changes the "time" value, so I tried with this:

console.log('time=1000')

but obviously it doesn't work. I find the writing "time = 1000" but the value of "time" is not changed, and when I manually write it from the console the number 1000 is purple, instead after the execution of the chrome extension if I check the console the writing is there but the number is black.

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