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

83
Views
how to redirect to another page with a service woker

I have web site for online planning. I added an indexddb and a service worker for manage offline connection. All of my code work perfectly, but I have a littel problem. When I click on a link of my web planning, the browser loads the html of the ligne planning instead of the off ligne html.

I found a solution to this by fetching the POST request, and I can watch the reponse. It's work perfectly.

My question: how can I redirect to html of off ligne planning. I found following code on the web, but it doesn't work:

    if (event.request.url.includes("Visionnage/planningDownload"))
    {
        fetch("http://localhost/index.html",{method:"post",redirect:'follow'})
             .then((e)=>{}).catch((e)=>{})
     }
about 4 years ago · Juan Pablo Isaza
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!