google-chromemanifestservice-workerprogressive-web-apps

Progressive Web App (PWA) redirect page into standalone mode


I have PWA and I can run it as standalone (if user clicks icon on a device) or I can run as normal website (if user enter URL directly into web browser). Is it possible to redirect page (open as standalone) if user open it as non standalone? My manifest file already contain standalone parameter:

 "display": "standalone"

I need something to start with.


Solution

  • As far as I know you need to "install" the pwa on the user device first.

    By clicking the icon on the device (meaning you already installed the app there) you open the PWA that will be rendered as described in the web manifest (standalone in your case).

    If you wouldn't have already installed the pwa on the device, you would have the same behaviour you are getting on your desktop by accessing the web site with the browser.

    Let me know if I misunderstood your question.


    UPDATE

    The answer to your question (in the comment) is no (from a desktop browser). Chrome on an Android device uses/opens directly the PWA version, if installed of course. This is due to the Android Intent Filters that enable this.

    But this is not the case from a desktop browser, where the user accesses the web site by entering the url manually. Maybe in the future it might change, but at the moment it is not possible.