You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
676 B
26 lines
676 B
/** |
|
* PWA detection utilities |
|
*/ |
|
|
|
/** |
|
* Check if the app is running as a PWA (installed/standalone mode) |
|
*/ |
|
export function isPWAInstalled(): boolean { |
|
if (typeof window === 'undefined') return false; |
|
|
|
// Check for standalone display mode (most common) |
|
const isStandalone = window.matchMedia('(display-mode: standalone)').matches; |
|
|
|
// Check for iOS standalone mode |
|
const isIOSStandalone = (window.navigator as any).standalone === true; |
|
|
|
return isStandalone || isIOSStandalone; |
|
} |
|
|
|
/** |
|
* Get the current URL to open in browser |
|
*/ |
|
export function getBrowserURL(): string { |
|
if (typeof window === 'undefined') return '/'; |
|
return window.location.href; |
|
}
|
|
|