I have a Progreesive web app(PWA). In that i have a manifest.json
. I want to set the manifest’s start_url
as Current url. Is there any way to set start_url
to the current url, when installing the app?
Note:- In my PWA i every user gets a unique url to their account. So when they install the PWA, the start_url
should be their current_url
(ex: https://example.com/user/id=abc1322112 )
I tried to change the manifest using script.js. nothing works.
2
Answers
if anyone needed, this script works.
delete your manifest.json and put this scipt inside your JS or html. replace your icon with "icon-192x192.png"
You can’t change the URL in the manifest, but you can set it to a fake URL that the service worker will redirect.
Manifest:
Service worker: