0

I'm 'upgrading' my web application towards a Progressive Web Application by including a Web App Manifest. I'm particularly interested in the start_url argument since my application behaves slightly differently if the bookmarked URL includes a user-determined parameter specifying a location. Think https://www.example.com?location=Amsterdam. In short, I can't include the user's interest in the generic start_url argument in a static Web App Manifest, since it differs per user: https://www.example.com?location=Amsterdam, https://www.example.com?location=London, https://www.example.com?location=Paris.

The documentation on start_url is a bit confusing, as web.dev from Google Developers mentions: "The start_url is required and tells the browser where your application should start when it is launched, ..." The oft-done suggestion is that start_url equals "/" to the root of the web application.

MDN from Mozilla mentions start_url as not mandatory, and includes a note "The start_url member is purely advisory, and a user agent may ignore it or allow the user to alter it at install time or afterwards."

So, which is it? Is start_url required / mandatory, or not?

Jochem Schulenklopper
  • 6,452
  • 4
  • 44
  • 62
  • 1
    the web manifest specification is not strict, so there is variation and interpretation between user agents as to what is and is not required. But you should include this to trigger the native prompt in Edge & Chrome. It is a requirement for them to get a proper homescreen icon, APK, etc. – Chris Love Sep 04 '20 at 20:22
  • 1
    as for being dynamic that is a bit more complex with an it depends sort of answer. Meaning I can think of several solutions to this problem. But it sounds like you are trying to taylor the user's preferences, which can be done via queryString, but probably should be part of their user profile and driven as the app loads. You could drive some of that from the service worker. – Chris Love Sep 04 '20 at 20:24
  • Thanks, @ChrisLove. I have no intention to make the `start_url` really dynamic, but just store/bookmark as the user prefers. So, I might want to bookmark `https://www.example.com/location=Houston`, another user might prefer `https://www.example.com/location=Atlanta`. It's not clear from the documentation about `start_url` whether that'll be respected... in additional to that's unclear whether the attribute is mandatory. (In my case, it's a stateless app without user profiles, so the preference can't be retrieved from user settings. Otherwise that would be the best way.) – Jochem Schulenklopper Sep 05 '20 at 16:16

0 Answers0