web-app-origin-association (scope extensions)

Demo · format-valid de-facto

/.well-known/web-app-origin-association

Standard: Web App Scope Extensions (WICG / Chrome)

The validation file a target origin hosts to grant a PWA extended scope across its domain.

What it is

Scope extensions let an installed PWA claim pages on other origins (e.g. support.example.com) as part of its app. Because that is a dangerous power, it requires a two-way handshake: the PWA lists the origins in its manifest's scope_extensions, and each target origin must host a JSON file at /.well-known/web-app-origin-association granting that specific manifest id a scope.

The threat it addresses

Without the handshake, any site could claim ownership of another domain's pages by simply naming them in a manifest. The well-known file is the target origin's explicit opt-in: browsers only extend scope for ids that appear there, scoped to the path the file allows.

How it works

  • The main PWA declares scope_extensions in its manifest, naming each origin it wants to include.
  • Each target origin serves /.well-known/web-app-origin-association (no .json extension, 200 OK, no redirects) mapping the PWA's manifest id to an allowed scope.
  • On install, the browser fetches each validation file; missing files, 404s, or absent ids reject that extension.

Honesty notes

  • Demo: illustrative association file keyed by this host's manifest id. No PWA actually extends into this origin.

Try it

Live demo

Format demo — the two-way handshake a PWA needs before it can claim this origin

Content-Type: application/json; charset=utf-8
{
  "https://well-known.page/": {
    "scope": "/"
  },
  "_demo_note": "Illustrative scope-extension association file for well-known.page. A PWA whose manifest id matches the key would be granted this origin's scope; no real PWA extends into this host."
}