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

196
Vistas
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 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