feat(pwa): installable app (Add to Home Screen) for Android + iOS
- manifest.json (standalone display, theme color, maskable icons 192/512). - generated square icons + apple-touch-icon (180) from the logo. - apple-mobile-web-app + theme-color meta in home.html. - sw.js gets a no-op fetch handler so it meets installability criteria (still no caching). static.js serves .json/.webmanifest with correct MIME. - Installing as a PWA also unlocks Web Push on iOS (Apple requires Add to Home Screen). Build marker -> pwa1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
+10
-2
@@ -2,8 +2,16 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<title>BizGaze Connect</title>
|
||||
<!-- PWA: installable on Android & iOS ("Add to Home Screen"); also enables iOS web push -->
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<meta name="theme-color" content="#1F3B73">
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="apple-mobile-web-app-title" content="Connect">
|
||||
<style>
|
||||
:root{ --brand:#FFC708; --brand-d:#E0AC00; --blue:#1F3B73; --blue-d:#16294f; --blue-soft:#EAF0FB; --ink:#1f2430; --muted:#6b7280; --bg:#f6f8fb; --card:#fff; --line:#e6e9ef; --green:#16a34a; --red:#b91c1c; }
|
||||
*{box-sizing:border-box;}
|
||||
@@ -589,7 +597,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<script src="/icons.js?v=3"></script>
|
||||
<script>window.__BUILD='2026-06-24-push4';console.log('%cBizGaze Connect','color:#1F3B73;font-weight:bold','build '+window.__BUILD);</script>
|
||||
<script>window.__BUILD='2026-06-24-pwa1';console.log('%cBizGaze Connect','color:#1F3B73;font-weight:bold','build '+window.__BUILD);</script>
|
||||
<div class="loading" id="loading">Loading…</div>
|
||||
|
||||
<header>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "BizGaze Connect",
|
||||
"short_name": "Connect",
|
||||
"description": "Chat, screen share, and video meetings for the BizGaze ecosystem.",
|
||||
"start_url": "/home",
|
||||
"scope": "/",
|
||||
"display": "standalone",
|
||||
"orientation": "portrait-primary",
|
||||
"background_color": "#1F3B73",
|
||||
"theme_color": "#1F3B73",
|
||||
"icons": [
|
||||
{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" },
|
||||
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" },
|
||||
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
|
||||
]
|
||||
}
|
||||
@@ -4,6 +4,10 @@
|
||||
// the background / frozen / closed, and to open the right chat when one is clicked.
|
||||
self.addEventListener('install', (e) => { self.skipWaiting(); });
|
||||
self.addEventListener('activate', (e) => { e.waitUntil(self.clients.claim()); });
|
||||
// No-op fetch handler: present only so the app meets PWA installability criteria. It never
|
||||
// calls respondWith(), so the browser performs its normal network fetch — NO caching, so this
|
||||
// can never serve a stale app.
|
||||
self.addEventListener('fetch', () => {});
|
||||
|
||||
self.addEventListener('push', (event) => {
|
||||
let d = {};
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ const { json } = require('./lib');
|
||||
const { currentUser } = require('./session');
|
||||
const { PUBLIC_DIR, REC_DIR, TRANS_DIR, UPLOADS_DIR } = require('./config');
|
||||
|
||||
const MIME = { '.html': 'text/html', '.js': 'text/javascript', '.css': 'text/css', '.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.svg': 'image/svg+xml', '.ico': 'image/x-icon' };
|
||||
const MIME = { '.html': 'text/html', '.js': 'text/javascript', '.css': 'text/css', '.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.svg': 'image/svg+xml', '.ico': 'image/x-icon', '.json': 'application/json', '.webmanifest': 'application/manifest+json' };
|
||||
|
||||
function serveStatic(req, res) {
|
||||
let p = req.url.split('?')[0];
|
||||
|
||||
Reference in New Issue
Block a user