← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

PWA Installation & Add to Homescreen

Mobile HTML5 Intermediate
debt(d3/e3/b3/t7)
d3 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'default linter catches the common case' (d3) — Lighthouse (listed in detection_hints.tools) automatically audits PWA installability criteria (manifest, service worker, HTTPS, icons) and flags missing pieces clearly.

e3 Effort Remediation debt — work required to fix once spotted

Closest to 'simple parameterised fix' (e3) — quick_fix is adding a manifest.json with required fields plus registering a service worker; it's more than one line but localised to a small set of static assets and a registration script.

b3 Burden Structural debt — long-term weight of choosing wrong

Closest to 'localised tax' (b3) — applies_to is web context only; the manifest and service worker are isolated artifacts that don't shape the rest of the app architecture, though they do require ongoing maintenance of icons/start_url.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap' (t7) — misconception explicitly states devs assume install happens automatically once criteria are met, but you must capture beforeinstallprompt and trigger UI yourself; plus iOS Safari doesn't fire the event at all, contradicting cross-browser expectations.

About DEBT scoring →

Also Known As

add to homescreen beforeinstallprompt web app manifest PWA install

TL;DR

Progressive Web Apps can be installed to the home screen like native apps — requiring HTTPS, a Web App Manifest, and a Service Worker, plus meeting browser-specific installation criteria.

Explanation

PWA installation criteria (Chrome): HTTPS, registered service worker, valid Web App Manifest (name, icons 192px+512px, start_url, display: standalone). The beforeinstallprompt event fires when the browser decides the app is installable — capture it to show a custom install button rather than relying on the browser's default banner. iOS: does not support the beforeinstallprompt event — you must show manual instructions. Installed PWAs: get their own window, appear in task switcher, have their own icon, and can be launched from home screen without browser UI.

Common Misconception

PWA installation happens automatically once criteria are met — Chrome waits for user engagement before showing the install prompt; you must capture the beforeinstallprompt event and show your own UI at the right moment.

Why It Matters

Installed PWAs have 3x higher engagement than browser sessions — the home screen icon provides the same discoverability and re-engagement as a native app without the App Store friction.

Common Mistakes

  • Not handling iOS separately — Safari does not support beforeinstallprompt; show a manual instruction banner.
  • manifest start_url not served by service worker — breaks offline functionality after installation.
  • Icons not including 512px — required for Chrome install prompt.
  • Showing install prompt too early — capture the event, but show the UI after demonstrating value.

Code Examples

✗ Vulnerable
// Missing manifest fields — not installable:
// manifest.json:
{
    "name": "My App"
    // Missing: icons, start_url, display, theme_color
}
// Result: browser never fires beforeinstallprompt
✓ Fixed
// Complete manifest:
// manifest.json:
{
    "name": "CodeClarityLab Glossary",
    "short_name": "Glossary",
    "start_url": "/glossary/?source=pwa",
    "display": "standalone",
    "theme_color": "#1a1a2e",
    "background_color": "#1a1a2e",
    "icons": [
        {"src": "/icons/192.png", "sizes": "192x192", "type": "image/png"},
        {"src": "/icons/512.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable"}
    ]
}

// Custom install button:
let deferredPrompt;
window.addEventListener('beforeinstallprompt', e => {
    e.preventDefault();
    deferredPrompt = e;
    document.getElementById('install-btn').hidden = false;
});
document.getElementById('install-btn').addEventListener('click', () => {
    deferredPrompt.prompt();
});

Tags


Added 16 Mar 2026
Edited 22 Mar 2026
Views 442
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 0 pings W 0 pings T 0 pings F 20 pings S 20 pings S 23 pings M 9 pings T 16 pings W 21 pings T 23 pings F 14 pings S 14 pings S 14 pings M 16 pings T 14 pings W 10 pings T 9 pings F 13 pings S 8 pings S 9 pings M 9 pings T 14 pings W 5 pings T 14 pings F 9 pings S 8 pings S 5 pings M 4 pings T 0 pings W
No pings yet today
ChatGPT 3 Perplexity 1
ChatGPT 370 Perplexity 19 Amazonbot 7 Google 6 Scrapy 5 Ahrefs 4 Unknown AI 2 Claude 2 Bing 2 PetalBot 2 Meta AI 1 Common Crawl 1 SEMrush 1
crawler 415 crawler_json 7
DEV INTEL Tools & Severity
🔵 Info ⚙ Fix effort: Medium
⚡ Quick Fix
Add a web app manifest (manifest.json) with icons, name, and display: standalone — browsers show an 'Add to Home Screen' prompt when your PHP app meets the PWA installability criteria
📦 Applies To
any HTML5 web
🔗 Prerequisites
🔍 Detection Hints
No manifest.json linked in HTML; missing service worker registration; no HTTPS (required for PWA); icons not provided in required sizes
Auto-detectable: ✓ Yes lighthouse chrome-devtools
⚠ Related Problems
🤖 AI Agent
Confidence: Low False Positives: High ✗ Manual fix Fix: Medium Context: File


✓ schema.org compliant