[Matrix] PWA Manifest + Service Worker (offline + home screen install) #62
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What & Why
The Matrix 3D Workshop should work as a home-screen app on iPad and mobile — installed once, opens full-screen without the browser chrome. Adding a
manifest.jsonand a service worker caches all static assets so the app loads instantly and works offline between WebSocket reconnects.Depends on: Vite build system issue (Matrix must be bundled before service worker can cache assets)
Done looks like
manifest.json:name: "Timmy Tower Workshop",short_name: "Timmy Tower",theme_color: "#00ff88",background_color: "#000000",display: "fullscreen"beforeinstallpromptfiresOut of scope
Tasks
the-matrix/public/manifest.jsonwith all required fields. Add<link rel="manifest">toindex.html.public/icons/.the-matrix/public/sw.js: precache the Vite build output manifest on install; cache-first for static assets; network-first for/api/*; offline fallback page for navigation requests.sw.jsinjs/main.jsafter DOMContentLoaded.beforeinstallpromptinjs/ui.js; show a small "Install App" button in the header; callevent.prompt()on click.Relevant files
the-matrix/index.htmlthe-matrix/js/main.jsthe-matrix/js/ui.jsthe-matrix/public/