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

221
Views
How can I redirect a specific URL to another after a delay?

whenever I end up on a certain page, which has a certain URL ("A"), i want my browser (Chromium) to wait there 10 seconds (without doing nothing else) and then automatically redirect me to another specific URL ("B")

"A" is a page on a website that sometimes is automatically redirected to "B" in a few fractions of a second (if some conditions are satisfied), but sometimes isn't and it remains stuck there for the rest of its lifetime

I want to force the redirection to happen in every case, and 10 seconds are enough to see if the automatic redirection happened or I have to make it happen in another way

I've found several Chrome extensions that can set up an automatic redirect request, like Requestly or Redirector, but with none of those it's possible to add a "waiting" feature before the redirection

however, Requestly (the most advanced one) allows to load custom CSS or JS code to run it

I don't know absolutely nothing about programming, so what could I write to make the extension do what I want to do?

at least two algorithms could work; a simpler one "detects when I end up on "A", wait 10 s and then redirect to "B" no matter what", or a more sophisticated one "detects when I end up on "A", wait 10 s, see if I'm still on "A" and if yes then redirect to "B" "

thanks in advance for the help!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

setTimeout(
  function() {
    window.location.replace("http://stackoverflow.com");
  }, 10000);

EDIT:

If you want it to work for a specific page, you can wrap it with an if statement.

if (window.location.href === 'https://youtube.com') {
      setTimeout(
        function() {
          window.location.replace("http://stackoverflow.com");
        }, 10000);
}
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!