Skip to content

New rule: web app manifest (missing fields, broken icons, theme-color mismatch) #710

Closed

Description

@nc9

Problem

A site links a web app manifest with <link rel="manifest" href="/site.webmanifest"> and then forgets about it. A redesign renames the icons, a deploy drops the file, or a framework starter ships a manifest that still says "name": "My App" with icons that were never generated. Nothing breaks visibly on a desktop browser. On Android, "Add to Home screen" falls back to a screenshot icon and a generic name, the splash screen is blank, and the browser chrome takes a color that clashes with the page.

squirrel does not read the manifest today. The only nearby checks are:

  • core/favicon (packages/rules/src/core/favicon.ts) checks that <link rel="icon"> and <link rel="apple-touch-icon"> are declared (an Apple touch icon that is missing is already reported there, as info). It never fetches an icon.
  • social/asset-divergence compares <meta name="theme-color"> across pages, not against the manifest.
  • security/mixed-content flags an http: manifest URL on an HTTPS page.
  • ax/well-known-agent mentions manifests, but those are agent manifests (MCP, A2A), not the web app manifest.

Proposal

New rule mobile/web-app-manifest, site scope, reading the manifest the pages link to (normally one per site, so one fetch) plus its declared icons.

  • Error: the linked manifest answers 4xx/5xx, or its body is not valid JSON.
  • Warn: the manifest is served with a content type other than application/manifest+json or application/json (some browsers ignore it), it has neither name nor short_name, it has no start_url or a start_url on another origin, it has no display value, or it lacks a 192px and a 512px PNG icon.
  • Warn: a declared icon answers 4xx/5xx, or its real pixel size differs from its declared sizes (read from the image header, as the image rules already do).
  • Warn: the page's theme-color meta and the manifest's theme_color disagree. A light/dark pair of theme-color metas scoped by media counts as agreeing when either matches.
  • Info: no icon with purpose including maskable (Android crops non-maskable icons into a circle).
  • Info: no page links a manifest at all. Plenty of sites legitimately have none, so this is advice, not a problem, and it does not affect the score.
  • One finding per manifest URL, listing the pages that link it, not one per page.

Not reported here:

  • A missing apple-touch-icon or favicon: core/favicon already covers it.
  • Pages whose theme-color differs from other pages: social/asset-divergence covers it.
  • Full installability (service worker, offline behaviour). That needs a browser and is out of scope.

Category: mobile

The manifest controls what a phone shows when the site is installed or pinned: the home-screen icon and name, the splash screen and the browser chrome color. That is the same audience as the existing mobile/ rules (viewport, tap targets, font size). core is page-level meta that search engines read, and search engines do not use the manifest.

Notes

  • Cost: one request for the manifest plus at most a handful for its icons, fetched once per site through the existing resource fetch (caps, timeouts and cache apply). The image header parser in packages/audit-engine/src/image-header.ts already reads dimensions without downloading whole files.
  • False-positive risk: low. A catch-all server that answers the manifest URL with an HTML page fails the JSON check, which is the right answer: the browser cannot use it either. The content-type check only warns.
  • Relative URLs: start_url, scope and icon src resolve against the manifest URL, not the page URL. Easy to get wrong; the fixtures should cover it.
  • Spec: https://www.w3.org/TR/appmanifest/

Acceptance Criteria

  • Fixture: a page linking /site.webmanifest that returns 404 produces an error finding naming the manifest URL and the linking pages
  • Fixture: a manifest whose body is not valid JSON (or is an HTML page served with 200) produces an error finding
  • Fixture: a valid manifest served as text/plain produces a content-type warning; the same file as application/manifest+json does not
  • Fixture: a manifest missing both name and short_name, one missing start_url, and one missing display each produce a warning naming the missing field
  • Fixture: a manifest with no 512px PNG icon produces a warning; one with 192px and 512px PNG icons does not
  • Fixture: an icon declared sizes="512x512" whose file is 256x256 produces a warning showing both sizes; an icon that returns 404 produces a warning naming its URL
  • Icon src and start_url are resolved against the manifest URL (fixture: manifest at /static/m.json with "src": "icon.png" checks /static/icon.png)
  • Fixture: <meta name="theme-color" content="#000"> with manifest "theme_color": "#fff" produces a warning; a light/dark pair where one matches does not
  • A manifest with no maskable icon produces an info result, not a warning
  • A site with no <link rel="manifest"> on any page produces one info result and no score penalty
  • Ten pages linking the same manifest produce one finding listing those pages, and the manifest is fetched once
  • A missing apple-touch-icon is not reported by this rule (it stays with core/favicon)
  • The rule has a docs page under docs/rules/mobile/

Activity

  1. added
    enhancement
    size: M
    rules
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessize: M

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions