Fixed PWA on iOS 27
This commit is contained in:
1 parent
c575a8dcba
commit
a39f97a4be
5 files changed
+43
-4
No files matched your search
@@ -17,11 +17,34 @@ const page = usePage<SharedProps>().props
|
||||
router.on('success', () => {
|
||||
transitionKey.value++;
|
||||
});
|
||||
|
||||
const isIOS27PlusPWA = (() => {
|
||||
const ua = navigator.userAgent;
|
||||
|
||||
const isStandalone =
|
||||
window.matchMedia('(display-mode: standalone)').matches ||
|
||||
(navigator as Navigator & { standalone?: boolean }).standalone;
|
||||
|
||||
if (!isStandalone) return false;
|
||||
|
||||
// iPhone / iPad detection
|
||||
const isIOS =
|
||||
/iPhone|iPad|iPod/.test(ua) ||
|
||||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
||||
|
||||
if (!isIOS) return false;
|
||||
|
||||
// iOS 27+ detection (Safari version token)
|
||||
const version = ua.match(/Version\/(\d+)/);
|
||||
|
||||
return version && parseInt(version[1]) >= 27;
|
||||
})();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Radar>
|
||||
<div class="layoutContainer">
|
||||
<div v-if="isIOS27PlusPWA" class="ios-top-bar"></div>
|
||||
<MainHeader :key="`header-${transitionKey}`" />
|
||||
<Transition name="fade" mode="out-in">
|
||||
<main id="pageContainer" :key="`main-${transitionKey}`">
|
||||
@@ -49,6 +72,16 @@ router.on('success', () => {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.ios-top-bar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 6px;
|
||||
z-index: 9999;
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
header,
|
||||
footer {
|
||||
flex: 0 0 5dvh;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
<link rel="apple-touch-icon" href="/img/app_icons/apple-touch-icon-180.png">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="apple-mobile-web-app-title" content="FlightsGoneBy">
|
||||
<script defer src="https://stats.dredgy.au/script.js" data-website-id="70a7276c-bdd3-4833-b286-4962ab28b5b5"></script>
|
||||
<link rel="apple-touch-startup-image" media="screen and (device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/img/logos/apple-splash-portrait-2048x2732.png">
|
||||
|
||||
Reference in new issue
Block a user