15

Consider I have:-

  • PWA at myapp.firebaseapp.com with it's own manifest.json.
  • Admin for the PWA at myapp.firebaseapp.com/admin

Is it possible to have another manifest.json for the admin URL to allow "Add to Home Screen" on the same PWA?

2 Answers 2

25

Sure; the manifest for a given page is determined by the presence of a DOM element with details about the manifest's location.

Assuming you have full control over the HTML for /admin and for all other pages, you can include <link rel="manifest" href="/path/to/admin-manifest.json"> in the HTML for /admin, and <link rel="manifest" href="/path/to/user-manifest.json"> in the HTML for other pages.

Each of the manifests can include, e.g., a different start_url value so that they take the user to a different initial page.

3
  • FYI, I am using Polymer Starter Kit, which is a SPA (Singe Page Appilcation) serving from index.html with one manifest.json. Would putting 2 <link rel="manifest"> linking to 2 different manifest.json` works?
    – Andrew See
    Sep 13, 2017 at 20:04
  • 2
    I'm trying to do same thing in my Angular application, but only first included manifest is considered & rest are ignored. Any idea why?
    – Anshul
    Jul 3, 2020 at 19:02
  • I tried to find an authentic source to cite but couldn't. You can only link to one manifest per page.
    – viam0Zah
    Oct 11, 2022 at 20:59
4

Old questions, but I want to add to the conversation in case anyone else gets here via Googling - It's possible to remove the start_url completely from your manifest, and the default behavior should be to open your PWA to whatever page the user was on when he saved the app to the device home screen. This ended up being a better solution in my case, ymmv.

1
  • 2
    does that also work for singlepage apps? (e.g. a create-react-app)
    – dcts
    Sep 8, 2021 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.