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

188
Vistas
Change one tab multiple times with an extension

I want to build a chrome extension that will search 30 different things up on the same tab. I tried the location.replace method and the _self method but nothing happened. However, when I tried window.open, it did work. This only opens a new window once, but I want it to open multiple times. How would I do this?

This is my code so far (arr is an array with some words):

function sleep(milliseconds) {
  const date = Date.now();
  let currentDate = null;
  do {
    currentDate = Date.now();
  } while (currentDate - date < milliseconds);
}
for(var i = 0; i<30; i++) {
  window.open('https://www.bing.com/search?q='+arr[Math.floor(Math.random() * arr.length)]);
  sleep (1000);
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can do it giving a different name to each one:

window.open(url, `${Math.random()}`);

Window.open()

about 4 years ago · Juan Pablo Isaza Denunciar
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