Back to Blog

Web Platform Standards / Progressive Web Apps

Modern Web Guidance
Progressive Web Apps (PWAs)

A Progressive Web App (PWA) is a website engineered with open web standards so it behaves like a dedicated application when a browser and device support it. Modern Web Guidance steers developers toward native platform APIs, Baseline interoperability and respectful user consent instead of unnecessary native mobile wrappers.

Catalogue Scope 269 Web features covered across CSS, HTML, JavaScript and dedicated PWA guides
Baseline Browser Set 4 Browsers Chrome, Edge, Firefox and Safari on desktop and mobile, running on 3 engines (Blink, Gecko, WebKit)
Widely Available 30 Months Time after a feature reaches every core browser before it counts as Widely Available
Fallback Budget < 50 LOC Preferred ceiling for lightweight custom fallbacks over heavy libraries
01 / Core Philosophy

Web-first architecture beats redundant native wrappers

Historically, teams built separate iOS, Android and desktop binaries whenever users wanted an icon on their home screen or basic offline access. Public digital guidance (such as OMB M-23-22) draws a sharp line between native operating system apps and mobile web applications optimised for browsers: maintaining parallel native apps introduces heavy maintenance overhead, app-store review delays and fragmented accessibility.

Modern Web Guidance - published by Chrome for Developers and stewarded by the Google Chrome, Microsoft Edge, Mozilla Firefox and MDN teams - closes that gap. Rather than shipping bloated frameworks or wrapping a site inside a native shell, it directs developers to combine progressive enhancement with Baseline browser compatibility data.

How Baseline categorises PWA capabilities

Governed by the W3C WebDX Community Group, Baseline measures when a web feature works reliably across all the core browsers (Chrome on desktop and Android, Edge, Firefox on desktop and Android, plus Safari on macOS and iOS). Those browsers run on three engines: Blink, Gecko and WebKit.

Widely Available (30+ months) Newly Available (all core browsers) Limited Availability (not yet in all core browsers)

By default, Modern Web Guidance treats Widely Available capabilities as safe without polyfills. Any PWA capability with Limited Availability - such as Chromium's beforeinstallprompt event - must be treated as an additive enhancement behind strict feature detection.

Progressive enhancement and feature gating

A PWA should never fail when a browser lacks an install prompt or background sync API. Start with accessible, fast HTML that works in any browser; layer manifest metadata, service worker caching and install triggers on top.

Origin Trial and Volatile Feature Gates

Guides for experimental Origin Trial APIs and volatile features (single-engine features shipped within the last three months or still stabilising) remain discoverable through search but are gated on retrieval, so agents don't adopt them without the developer's consent. Opt in per project with a .mwgrc file containing "allowOriginTrials": true or "allowVolatileFeatures": true.

PWA Building Block Role in a Web App Baseline Status Modern Web Guidance Rule
Web App Manifest JSON file defining app name, icons, start URL and window display mode Widely Available Always include a valid manifest with explicit id and accessible icons
Service Workers & Cache API Background proxy intercepting network requests for speed and offline use Widely Available Guard registration with 'serviceWorker' in navigator; avoid caching POST mutations
beforeinstallprompt Event Fires before Chromium shows its install UI so pages can offer a custom button Limited Availability Chromium-only fallback for installing the current app; prefer the Web Install API when both exist
Web Install API The <install> element and navigator.install() open browser-controlled consent UI Limited / Emerging Prefer <install>; for a custom button, detect typeof Navigator.prototype.install === 'function' and call it directly from a click
Origin Migration Metadata Moves an installed PWA, with its shortcuts and icons, to a new same-site origin Limited (Chrome 150+) New manifest declares migrate_from; old origin approves in /.well-known/web-app-origin-association; migrate user data separately
02 / Guide: install-web-app

Installing web apps via browser-controlled consent UI

Modern Web Guidance's install-web-app guide establishes one foundational rule: the browser always owns the final installation consent dialogue. Web pages cannot silently install themselves onto a user's operating system, nor should they simulate fake OS install popups.

Instead, developers offer a calm, accessible in-page install button that activates only when the user chooses to click it, handing control back to the browser's trusted consent sheet.

1. The <install> element (preferred)

The simplest option. The browser draws and labels the button itself, so it can't be spoofed and needs no JavaScript. With no attributes it installs the current page's app, which needs a manifest that declares an id. Add a manifest attribute to offer a different app, including a cross-origin one. Anything you put inside the element is shown only in browsers that don't support it.

<!-- Installs the current document's app -->
<install></install>

<!-- Offers another app (it may be cross-origin) -->
<install manifest="https://app.example/manifest.webmanifest"></install>

<script>
  document.querySelector('install')?.addEventListener('installresult', (event) => {
    // event.result is "success", "aborted" or "invalid-data"
  });
</script>

2. navigator.install() for a custom button

When you need your own button, call navigator.install() directly inside its click handler: a delayed call loses the user gesture and throws NotAllowedError. With no arguments it installs the current app; to offer a different one, pass { manifest, manifestId }, which adds a web-app-installation permission prompt before the confirmation dialogue. The promise also resolves when the user agrees to open an app that is already installed, and the page can't tell the two apart.

const supportsWebInstall = typeof Navigator.prototype.install === 'function';
const installBtn = document.getElementById('install-app-btn');

if (supportsWebInstall && installBtn) {
  installBtn.hidden = false;
  installBtn.addEventListener('click', async () => {
    installBtn.disabled = true;
    try {
      await navigator.install();
      installBtn.hidden = true;
    } catch (err) {
      // AbortError: cancelled or denied. DataError: manifest problem.
      installBtn.disabled = false;
    }
  });
}

3. beforeinstallprompt as a Chromium fallback

In Chromium browsers (Chrome and Edge), once a site meets the install criteria (HTTPS and a manifest with a name, icons, a start URL and an app-like display mode), the browser fires beforeinstallprompt. Calling event.preventDefault() stops the browser's own install promotion so you can store the event and reveal your button. It can only install the current app, and the event works once: clear your reference before waiting for the user's choice, and hide the button afterwards.

// Uses supportsWebInstall and installBtn from the previous example
let deferredPrompt = null;

window.addEventListener('beforeinstallprompt', (event) => {
  event.preventDefault();
  deferredPrompt = event;
  // Prefer navigator.install() when both are available
  if (!supportsWebInstall && installBtn) installBtn.hidden = false;
});

if (installBtn && !supportsWebInstall) {
  installBtn.addEventListener('click', async () => {
    const promptEvent = deferredPrompt;
    if (!promptEvent) return;
    deferredPrompt = null;      // the event is single-use
    installBtn.hidden = true;   // hide it whatever the user chooses
    await promptEvent.prompt();
    const { outcome } = await promptEvent.userChoice;
    console.log(`Install prompt outcome: ${outcome}`);
  });
}

window.addEventListener('appinstalled', () => {
  deferredPrompt = null;
  if (installBtn) installBtn.hidden = true;
});
Interactive Lab 01

Install Flow Simulator

Lifecycle Steps

    Simulated Browser & Consent UI

    Chrome / Edge https://example.com/notes Web Tab

    STEP 1 OF 5

    Initial Page Load

    EVENT LOG: Waiting for browser installability check…
    03 / Guide: migrate-web-app-origin

    Transferring an installed PWA via origin migration

    On the web, an origin (scheme + host + port) is a strict security boundary. Moving your application from legacy.example.com to app.example.com does not automatically move user preferences, cached files or operating system desktop shortcuts.

    Modern Web Guidance's migrate-web-app-origin guide describes Web App Origin Migration (Chrome 150 and later): a handshake in which the new app names its predecessor and the old origin approves the move. The browser then moves the installation, including shortcuts and home-screen icons. Both origins must be same-site, sharing one registrable domain: app.example.com to new.example.com is allowed, example.com to example.org is not.

    Interactive Architecture Walkthrough

    4-Stage Origin Migration Sequence

    Phase 01 · Required

    New App Declares Predecessor

    The manifest on app.example.com lists the old app in migrate_from. The new app must declare an id.

    Phase 02 · Required

    Old Origin Authorises

    old.example.com serves /.well-known/web-app-origin-association with allow_migration: true.

    Phase 03 · Optional

    Old App Signals the Move

    migrate_to in the old manifest lets installed users be offered the update without visiting the new site.

    Phase 04 · Your Job

    Move Data, Cover Gaps

    Storage and permissions stay behind. Migrate data yourself and show a banner where migration isn't supported.

    Phase 1 - Confirm Same-Site, Then Declare the Predecessor

    Both origins must share one registrable domain (eTLD+1): app.example.com to new.example.com, or example.com/app1 to example.com/app2, is allowed; example.com to example.org is not. In the new app's manifest, add migrate_from with the old app's manifest ID. The new app must declare its own id.

     

    Preserving Local State Safely

    The migration moves the installation, not the data: LocalStorage, IndexedDB, cookies and permissions stay tied to the old origin. Move preferences, unsynced drafts and theme choices with server-side sync or an origin-checked postMessage channel, and validate event.origin strictly on both ends so untrusted sites cannot read user configuration.

    Handling Service Worker Scope

    Service workers and Cache Storage belong to their origin too. Register the new app's worker on the new origin, and once users have moved, update the old origin's worker so it clears obsolete caches rather than serving stale content.

    Honest Fallback for Unsupported Browsers

    In browsers without automatic migration, users stay on the old installation. Show a clear banner on the old origin pointing to the new site, and explain that they'll need to reinstall because their settings don't carry over automatically.

    04 / Manifest Architecture

    The Web App Manifest shapes how the OS sees your site

    A Web App Manifest (typically served as manifest.webmanifest and linked via <link rel="manifest" href="/manifest.webmanifest">) tells the operating system your application's title, launch URL, colour palette, icon set and window chrome.

    Adjust the fields in the interactive builder below to watch both mobile and desktop mockups update in real time.

    Interactive Lab 02

    Manifest Builder & Live Device Preview

    Shown on splash screens and install prompts.
    Used under home-screen icons where space is tight.
    Decouples app identity from start_url edits.
    Must sit within your manifest scope.

    Generated manifest.webmanifest

     

    Live OS & Device Preview

    09:41 standalone

    LAUNCHED PWA

    Field Notes Studio

    Splash background fills immediately with background_color whilst assets hydrate.

    start_url: /?source=pwa
    FN
    FieldNotes
    Home Screen Icon
    Field Notes Studio
    display: standalone

    Desktop Window Surface

    Renders in its own OS window frame tinted by theme_color without browser tab clutter.

    App ID: /?app=field-notes

    Icon Requirements Reminder

    Provide at least 192x192 and 512x512 PNG icons (plus optional vector SVG). Keep critical artwork inside the central 80% safe zone when marking an icon "purpose": "maskable" so adaptive OS masks do not clip edges.

    05 / Offline Resilience

    Service Workers turn network unpredictability into reliability

    A Service Worker is a JavaScript worker running on a background thread separate from the page's UI thread. Once registered and activated, it acts as a programmable network proxy: intercepting fetch events and deciding whether to serve from Cache Storage, fetch from the network or combine both.

    Modern Web Guidance emphasises choosing the right caching strategy per resource type rather than forcing one blanket rule onto every URL.

    Strategy 01

    Cache First

    Checks Cache Storage before touching the network. If found, returns the cached file in single-digit milliseconds; otherwise fetches from the network and stores a copy. Ideal for versioned CSS, hashed JS bundles, fonts and icons.

    Strategy 02

    Network First

    Requests the latest version from the origin server first. If the network succeeds, it updates the cache and returns fresh content; if offline or timing out, it falls back seamlessly to the last cached copy. Ideal for HTML pages and live feeds.

    Strategy 03

    Stale-While-Revalidate

    Serves the cached version immediately for zero-wait speed whilst silently fetching an updated response in the background for the next load. Ideal for user avatars, product catalogues and non-critical reference data.

    Interactive Lab 03

    Caching Strategy Request Visualiser

    Service Worker Request Routing Diagram CLIENT THREAD Browser Page /styles/app.v4.css NETWORK PROXY Service Worker Cache First LOCAL STORAGE Cache Storage Warm: Entry Present REMOTE SERVER Origin Network Online (45ms)

    Request Execution Trace

    Ready to simulate
    • 0 ms Select a strategy, resource and network state, then click Simulate Request. Idle
    06 / Knowledge Check

    Verify your PWA & Modern Web Guidance fluency

    Test your understanding of Baseline tiers, installability consent flows, origin migration, manifest configuration and service worker caching. Your progress is saved in this browser and restored when you come back.

    Question 1 of 6 Baseline & Installability

    Loading question…

    Sources & Attribution

    Adapted from Google's Modern Web Guidance (Chrome for Developers), including its Installing web applications and Migrating the origin of an installed web app guides; the Chrome blog post Seamless PWA origin migration; Revisiting Chrome's installability criteria; W3C WebDX Community Group Baseline definitions; web.dev Baseline articles; and public digital service design standards (M-23-22 and USWDS).