mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
Fix PWA install detection on iOS with additional check for MSStream
Co-authored-by: jxxghp <jxxghp@163.com>
This commit is contained in:
@@ -86,7 +86,7 @@ export function usePWAInstall() {
|
|||||||
const isPWASupported = computed(() => {
|
const isPWASupported = computed(() => {
|
||||||
const hasServiceWorker = 'serviceWorker' in navigator
|
const hasServiceWorker = 'serviceWorker' in navigator
|
||||||
const supportsInstallPromptEvent = 'onbeforeinstallprompt' in window
|
const supportsInstallPromptEvent = 'onbeforeinstallprompt' in window
|
||||||
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent)
|
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !(window as any).MSStream
|
||||||
|
|
||||||
return hasServiceWorker && (supportsInstallPromptEvent || isIOS)
|
return hasServiceWorker && (supportsInstallPromptEvent || isIOS)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user