Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set start_url in web app manifest based on the URL that was added to homescreen

Tags:

My site has several subsections. When a user adds the site to their homescreen, I'd like to make sure that the home screen icon launches them into the subsection they were on when they added to homescreen.

I can register a different manifest for each subsection, but this doesn't work for single page apps where there's no page reload. I'm considering storing the subsection in a cookie and then redirecting from a generic start URL based on that cookie.

Is there a better way to do this?

like image 896
drufball Avatar asked Sep 14 '16 16:09

drufball


1 Answers

If you remove the start_url from the manifest.json file then it will default to the page user was browsing while adding pwa app to homescreen. ref : https://developers.google.com/web/tools/lighthouse/audits/manifest-contains-start_url

like image 105
Fawaz Avatar answered Sep 22 '22 16:09

Fawaz