faisalman / ua-parser-js

UAParser.js - The Essential Tool for User-Agent Detection in JavaScript & Web Development.
https://uaparser.dev/
GNU Affero General Public License v3.0
8.85k stars 1.18k forks source link

Detect PWA #728

Closed jlarmstrongiv closed 1 week ago

jlarmstrongiv commented 1 month ago

Is your feature request related to a problem? Please describe. I would like to be able to detect if users have installed my app as a PWA, and when they switch from a PWA back to the browser or vice-versa. A PWA enables more features like notifications that are important for my app processing, and I would only like to enable this feature when the app is installed as a PWA, not in a plain browser tab.

Describe the solution you'd like Use media queries to detect whether the website is used as a PWA and listen to events for when it changes.

Describe alternatives you've considered Doing it myself. I think the UA parser is a better place to have all the browser detection functionality in one place.

Additional context I support you with both business and enterprise licenses