Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 691
Andrew See Avatar asked Sep 13 '17 17:09

Andrew See


People also ask

What is PWA manifest JSON?

The web app manifest is a JSON file that tells the browser about your Progressive Web App and how it should behave when installed on the user's desktop or mobile device.

Where do I put the PWA manifest?

Linking to your manifest # To make the browser aware of your web app manifest, you need to link it to your PWA using a <link> HTML element and the rel attribute set to manifest on all of your PWA's HTML pages. This is similar to how you link a CSS stylesheet to a document.

Why do we need a web manifest for PWA?

A web application manifest, as defined in the Web Application Manifest specification, provides information about a web application in a JSON text file, necessary for the web app to be downloaded and be presented to the user similarly to a native app (e.g., be installed on the homescreen of a device, providing users ...

What is a manifest file in context of PWA?

The PWA Web Manifest File. A web manifest file provides meta data to the browser, telling it how to theme the add to home screen experience so your brand is properly representing after you earn the deeper customer relationship. You also control how your PWA is launched form the homescreen.


1 Answers

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.

like image 61
Jeff Posnick Avatar answered Sep 22 '22 02:09

Jeff Posnick