0

I need my manifest.json file to be load ONLY on mobile devices, not tablets nor bigger devices. Is this possible using some hack on the file?

Can't provide background, sorry. I haven't tried this yet.

I expect my site to act like a web-app only on mobile.

Thanks.

  • I think it's impossible. As far as I know, PWA supports mobile, tablets, and desktop devices. And PWA doesn’t have support for any hardware that is not supported by HTML5. – Jessica Rodriguez Mar 27 '19 at 15:55
  • Ok, @jess, thanks for your time and answer. I thought that maybe I could use some kind of media query on this file specifying to only load on mobile. – Federico Artía Mar 28 '19 at 13:37

1 Answers1

1

You can create a placeholder for the manifest.json that is NOT loaded automatically by the browser. Then, when your JS executes, check whether you want the manifest to be available for the browser in question. Now dynamically make it available.

More on the approach here: https://medium.com/@alshakero/how-to-setup-your-web-app-manifest-dynamically-using-javascript-f7fbee899a61

pate
  • 4,937
  • 1
  • 19
  • 25