Be-Prepared / Be-Prepared.github.io

Handy PWA filled with useful tools.
Other
0 stars 0 forks source link

Show alert on unsupported browser or platform #46

Open fidian opened 3 weeks ago

fidian commented 3 weeks ago

Only Chrome on Android and only Safari on iOS. Permissions don't work properly and the PWA can't be installed with other browsers.

fidian commented 3 weeks ago

This is difficult. on iOS, only Safari allows correct permissions and installation of the PWA. On Android, it looks like only Chrome installs the PWA as an app and other browsers tend to install it as a shortcut. It is possible to detect if this is Android or iPhone by using (navigator.userAgentData ?? navigator).platform to support newer and older versions, but getting the actual browser is difficult. The most common methods use navigator.userAgent but that is extremely unreliable. For instance, Brave uses a userAgent identical to common browsers.

This will require more investigation.