LEARNING OBJECTIVES ⌵
- Configure a production-grade
manifest.webmanifestfile following the W3C Web App Manifest specification. - Master core manifest members:
name,short_name,id,start_url,scope,display,background_color, andtheme_color. - Differentiate between the 4 display modes:
fullscreen,standalone,minimal-ui, andbrowser. - Understand adaptive icon geometry, the 40% safe-zone margin rule for
purpose: "maskable", and multi-resolution icon definitions.
📖 The Mental Model & Story (Intuitive Foundation)
When you buy a passport or a national ID card, it contains standardized fields: your legal name, a short nickname, your home address, your nationality, and biometric photos formatted to strict dimensions (e.g., 2x2 inches on a white background). Without this standardized document, immigration officers cannot verify your identity, register your citizenship, or issue entry permissions.
The Web App Manifest (manifest.webmanifest) is the official passport of your web application.
When a mobile or desktop operating system (such as Android, iOS, Windows, or macOS) encounters a website, it sees a generic collection of HTML documents. The manifest provides the operating system with the cryptographic and visual identity needed to treat the website as a citizen of the OS: what icon to paint on the home screen, what color to paint the status bar, what URL to boot when the app icon is tapped, and whether to strip away the browser URL bar to give the app a pure, native window frame.
Technical Deep Dive & Specifications
The W3C Manifest Specification & Linking Syntax
The Web App Manifest is a JSON-based configuration file served with the standardized MIME type application/manifest+json. It is declared inside the <head> of your HTML document:
<!-- HTML Document Header -->
<link rel="manifest" href="/manifest.webmanifest">
MIME Type Rule: Although browsers will often parse files named
manifest.jsonserved asapplication/json, the W3C specification standardizes the.webmanifestfile extension andapplication/manifest+jsoncontent type.
Core Manifest Properties & Schema
{
"id": "/?app=finance_pro",
"name": "Apex Finance Portfolio Tracker",
"short_name": "ApexFinance",
"description": "Real-time stock and cryptocurrency portfolio monitoring engine.",
"start_url": "/dashboard.html?source=pwa",
"scope": "/",
"display": "standalone",
"orientation": "portrait-primary",
"background_color": "#0f172a",
"theme_color": "#3b82f6",
"categories": ["finance", "productivity", "utilities"],
"icons": [
{
"src": "/icons/icon-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
The 4 Display Modes Compared
The display member controls how much browser chrome (address bar, navigation buttons, menu bars) is presented to the user when the installed PWA launches:
+-------------------+ +-------------------+ +-------------------+ +-------------------+
| fullscreen | | standalone | | minimal-ui | | browser |
+-------------------+ +-------------------+ +-------------------+ +-------------------+
| No OS Status Bar | | OS Status Bar | | OS Status Bar | | Full Browser Bar |
| No Browser Bar | | No Browser Bar | | Minimal Back/Reload| | URL / Search Bar |
| Full Screen Pixels| | App Title Bar | | URL Indicator | | Tab Bar |
| (Immersive Games) | | (Native App Look) | | (Hybrid Web Look) | | (Standard Tab) |
+-------------------+ +-------------------+ +-------------------+ +-------------------+
| Display Mode | OS Status Bar Visible? | Browser URL Bar Visible? | Typical Use Case |
|---|---|---|---|
fullscreen |
❌ No (Hidden) | ❌ No | Immersive 3D games, VR experiences, digital signage, kiosk displays. |
standalone |
✅ Yes | ❌ No (Pure App Window) | Standard for 95% of PWAs: E-commerce, messaging, productivity tools. |
minimal-ui |
✅ Yes | ⚠️ Minimal (Back / Refresh only) | News readers and blogs where users frequently need page navigation controls. |
browser |
✅ Yes | ✅ Full Browser UI | Legacy web fallback; opens like a normal browser bookmark. |
Scope and start_url Mechanics
The scope defines the universe of URLs that belong to your installed application. If a user clicks a link inside your PWA that points outside the declared scope, the browser will open that link inside an external browser tab rather than the standalone PWA window.
Domain: https://example.com
Scope: "/app/"
+-------------------------------------------------------------------------------+
| Allowed inside Standalone Window: |
| https://example.com/app/ |
| https://example.com/app/dashboard |
| https://example.com/app/settings/profile |
+-------------------------------------------------------------------------------+
| Forced to External Browser Tab (Out of Scope): |
| https://example.com/blog/article-1 |
| https://example.com/login |
| https://github.com/example |
+-------------------------------------------------------------------------------+
Maskable Icons & The Safe Zone Rule
Android and various desktop operating systems apply arbitrary shapes to app icons: circles (Google Pixel), rounded squircles (Samsung OneUI), teardrops, or hexagons. If you provide a standard icon without margins, the OS will crop important logos.
Maskable Icons solve this by guaranteeing that all essential artwork sits within a central 80% safe zone diameter (a 10% margin on all 4 sides, or 40% radius from the center):
+-------------------------------------------------------------+
| FULL ICON BOUNDS (512 x 512 px) |
| |
| +---------------------------------------+ |
| | SAFE ZONE (409.6 x 409.6 px) | |
| | (All logos, text, & icons MUST sit | |
| | inside this safe diameter) | |
| | | |
| | [LOGO] | |
| | | |
| +---------------------------------------+ |
| |
| Outer 10% margin will be cropped by Android / Windows |
+-------------------------------------------------------------+
💻 Interactive Code Playground
Starter Code
Below is a complete HTML host file and an embedded dynamic manifest generator demonstrating manifest linking, theme matching, and live manifest inspection.
Line-by-Line Code Breakdown
- Line 8 (
<meta name="theme-color" content="#4f46e5">): Sets the fallback theme color for browser navigation bars on Android Chrome and Safari before the manifest loads. - Line 11 (
<link rel="manifest" href="manifest.webmanifest">): Standard declarative tag linking the JSON manifest to the DOM. - Line 66 (
"id": "/?pwa_app=volt"): Explicit unique identifier for the application according to the W3C spec; ensures identity persistence even ifstart_urlchanges later. - Line 70 (
"display": "standalone"): Instructs the OS window manager to suppress browser chrome and present a dedicated native window frame. - Line 77 (
"purpose": "any maskable"): Instructs the platform that this icon asset is safe for standard square rendering as well as circular/squircle adaptive OS masks.
Expected Browser Render Output
Web App Manifest Visualizer
Inspecting document metadata and manifest linkage.
Homescreen Icon Preview
[ ⚡ ]
App Name: Volt PWA Manager
Display Mode: standalone
Manifest JSON Schema
{
"id": "/?pwa_app=volt",
"name": "Volt PWA Manager",
"short_name": "Volt",
"start_url": "/?source=homescreen",
"scope": "/",
"display": "standalone",
...
}🏋️ Hands-On Exercise
🎯 The Challenge: Build a Complete Production Web App Manifest
Instructions:
- Author a complete, valid
manifest.webmanifestJSON configuration for a health application called "Pulse Health Tracker". - Provide a
short_nameof max 12 characters ("Pulse"). - Set the
start_urlto"/index.html?launcher=true"and limit thescopestrictly to"/app/". - Define two PNG icons (
192x192withpurpose: "any"and512x512withpurpose: "maskable"). - Specify
display: "standalone",background_color: "#1e1b4b", andtheme_color: "#6366f1".
🏁 Starter Code Sandbox
⚠️ Common Pitfalls
- Mismatched Scope and Start URL: Setting
start_url: "/app/home"while settingscope: "/portal/". Ifstart_urldoes not reside insidescope, the manifest is invalid and the browser will refuse installability. - Neglecting Maskable Icon Margins: Using an edge-to-edge logo with
purpose: "maskable". Android squircle masks will clip the outer 10–20% of your graphic. Always design maskable icons with the 40% radius safe-zone rule. - Missing
theme-colorMeta Tag in HTML: Relying solely ontheme_colorin the manifest. The manifest is parsed asynchronously; without<meta name="theme-color">in HTML<head>, the browser tab header will flash the default gray or white on initial page load.
💡 Pro Tips
- Specify an Explicit
id: Historically, browsers usedstart_urlas the unique application key. If you changed your query params or URL route, the browser treated it as a brand new app, orphaning existing user installations. Always declare"id": "/"to ensure stable app identity across major URL migrations. - Add Desktop Screenshots for Rich Install Dialogs: Providing a
"screenshots"array withform_factor: "wide"andform_factor: "narrow"unlocks Chrome and Edge's rich, beautiful app-store style desktop installation dialog.
📌 Key Takeaways
- The Web App Manifest is a JSON file (
manifest.webmanifest) declared via<link rel="manifest">providing metadata to the host operating system. - The
displaymember accepts four values:standalone(most common),fullscreen,minimal-ui, andbrowser. - The
start_urlmust reside within the declaredscopepath. - Maskable icons (
purpose: "maskable") require an 80% safe zone diameter (10% outer padding) to prevent edge clipping on adaptive OS surfaces. - Declaring an explicit
"id"prevents app duplication and maintains persistent identity across URL refactors. - --