Detecting display-mode for a PWA

I have a PWA that is packaged as a Android app via PWABuilder.com so it can be listed on stores.

If your default browser is Samsung Internet, then my media query for standalone doesn’t apply, and if using navigator.standalone to detect it with javascript, it is still not detected as being viewed as standalone.

Chrome uses display-mode which is excellent and the most ideal, Safari when opening the packaged app uses navigator.standalone so it can still be detected at least, but there seems to be no way at all for me to detect if the app is running as standalone in Samsung Internet.

This specifically seems to be more of an issue if the PWA is packaged within an app running via Samsung Internet, rather than downloading the PWA direct from the webpage.

Hello, @joshdwhitehouse

Web App (PWA) is running in standalone mode within Samsung Internet can be tricky. Here are some insights and workarounds:

Samsung Internet Behavior:
Unlike other major browsers (such as Chrome, Opera, Firefox, Edge, and Safari), Samsung Internet doesn’t consistently report the correct display mode for PWAs.
When opening a PWA, Samsung Internet often displays “browser” mode instead of “standalone” mode.
Workaround: Query String Parameter:
Set the start URL in your PWA’s manifest file to include a query string parameter, for example:
JSON

“start_url”: “./?mode=standalone”
AI-generated code. Review and use carefully. More info on FAQ.
In your JavaScript code, check for this query string parameter.
If the parameter is present, you can assume that the PWA is running in standalone mode.
Since the address bar is not visible to the user in standalone mode, this approach won’t affect their experience.
Keep Monitoring Updates:
Unfortunately, there’s no direct solution provided by Samsung Internet at the moment.
Continue monitoring updates and documentation from Samsung to see if they address this issue in future releases.

Remember that PWAs are evolving, and browser behavior may differ across platforms.

I hope this info is helpful to you.

Best Regard,
Krina Pestro

Hi Krina,

That is a great idea for a workaround; I’ll give this a shot, thank you! It’s a big shame there are so many glaring issues with Samsung Internet and PWAs when Chrome has them handled perfectly, but am hopeful for the future!

It’s a bit of a concern when being listed on the Play Store and users on Samsung phones with Samsung Internet still set as their default browser can download the app and then just assume this is how it is and is missing so much functionality. So whilst I will 100% give this workaround a try as a temporary solution, I will still advise all users switch their primary browser to Chrome for the timebeing as it is ultimately a far superior experience with the PWA.

Thanks so much for your help.

Josh