Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!