feat: add iOS-focused PWA shell with service worker and manifest

This commit is contained in:
Oliver 2026-02-15 16:12:04 +01:00
parent 56b8825ca5
commit fea5fe9cbb
No known key found for this signature in database
9 changed files with 176 additions and 3 deletions

16
src/pwa.js Normal file
View file

@ -0,0 +1,16 @@
(function () {
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker.register("/service-worker.js").catch(() => {});
});
}
const isIos = /iphone|ipad|ipod/i.test(window.navigator.userAgent);
const isStandalone =
window.matchMedia("(display-mode: standalone)").matches || Boolean(window.navigator.standalone);
const hintEl = document.getElementById("ios-install-hint");
if (hintEl && isIos && !isStandalone) {
hintEl.textContent = "Tipp: Über Teilen > Zum Home-Bildschirm hinzufügen für App-Modus auf iOS.";
hintEl.classList.remove("hidden");
}
})();