Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
499 views
in Technique[技术] by (71.8m points)

progressive web apps - Possible to have multiple `manifest.json` for PWA?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...