Spec Commons
← Definitions
Published definition · immutable

PWA Help publisher support convention v1

Discover one app-publisher support destination from manifest support, JSON-LD or HTML, with exact URL and email rules and conformance cases.

JSON recordMarkdownCreate a derivative
Permanent URL
https://speccommons.org/s/pwa-help-publisher-support-v1
Identifier
sc_48db81fcb8974ff683c99c0a82f00cb5
Record schema
https://speccommons.org/s/definition-record
Publisher
pub_fe36aa0feef84fcebf76ef53dba6dab6
Published

Purpose and scope

This version records the publisher-support convention implemented by PWA Help. It lets a consumer choose one publisher-declared support destination from a web app manifest and the app page. It applies to help about the app, including installation, bugs, accounts and accessibility.

The manifest member support is a nonstandard PWA Help extension. This publication does not make it a browser standard. The consumer does not send email, execute page scripts or verify publisher or mailbox identity.

Inputs and result

Inputs are the final HTTPS app page URL after redirects, its HTML, an optional parsed manifest object, and the final URL of that manifest. If a manifest URL is not supplied, use the page URL. A missing manifest is an empty object.

Return either no destination (JSON null) or an object with url, kind and source. A web destination has kind: "web". An email destination has kind: "email" and also email, containing the normalized mailbox without the mailto: prefix. Source is exactly support, Schema.org softwareHelp or HTML rel="help".

Public HTTPS declaration URLs

Resolve URLs using JavaScript URL semantics against the stated base. Require HTTPS, no username or password, no nondefault port, and a serialized URL of at most 2,048 UTF-16 code units before fragment removal. The normalized hostname must contain a dot, must not end in a dot, must not consist only of digits and dots, and must not contain a bracket or colon. Reject the exact hostname metadata.google.internal and hostnames equal to or ending in a dot followed by any of localhost, local, internal, home, test, invalid, example, or onion. Remove the fragment in the returned URL. An explicit HTTPS port 443 normalizes to the default port and is allowed.

These are declaration-URL checks. DNS validation, redirect limits and fetching policy are separate concerns; a syntactically accepted declaration is not a guarantee that a host resolves publicly or that the destination is safe.

For HTML declarations, the base is the first base[href] resolved against the final page URL if it passes these rules; otherwise use the final page URL. That HTML base never changes email-domain authority.

Discovery and priority

Choose the first usable destination in this order; skip unusable candidates:

  1. The manifest's support member. It must be a string. Trim its surrounding whitespace. An explicit mailto: URI uses the email rules below; all other candidates use the public HTTPS declaration rules, resolved against the final manifest URL. A bare mailbox such as help@example.com is rejected rather than interpreted as a relative help path. No other manifest member is an alias for support.
  2. The first usable softwareHelp declaration in JSON-LD script elements with type="application/ld+json", in document order. Parse each script as JSON; ignore invalid JSON. Walk object values and array entries in their JSON order. An object is eligible when its @type string or array contains a value whose final component after splitting on / or # is SoftwareApplication, WebApplication or MobileApplication. Its softwareHelp may be one value or an array: use a string directly, or an object's truthy url, falling back to @id. Require a usable HTTPS declaration URL resolved against the HTML base. If no help value is usable, continue walking nested values. The implementation shares a budget of 200 visits across the scripts and visits depths 0 through 12 inclusive, where a script's parsed value is depth 0; each non-null object or array visit consumes one unit. No JSON-LD contexts are fetched or expanded.
  3. The first HTML link element having both rel and href whose lowercased whitespace-separated relation tokens include help. Resolve its href against the HTML base and require a usable HTTPS declaration URL. Later HTML help links are not tried if that first help link is invalid.

Only the manifest member can declare an email destination. JSON-LD and HTML candidates must resolve to HTTPS. If all three stages fail, return null. Query parameters supplied to the consumer never supply a publisher-support destination.

Email acceptance and normalization

Recognize the mailto: scheme case-insensitively. After the scheme, reject raw whitespace, ASCII controls, DEL, ? and #. Decode percent escapes once using UTF-8; reject invalid encoding. The decoded text must contain exactly one mailbox with these rules.

The local part is one or more ASCII letters, digits, underscores, plus signs or hyphens, optionally followed by dot-separated nonempty groups of those characters; its length is at most 64. The domain cannot contain another @, whitespace, slash, question mark, hash, colon, percent or backslash. Normalize the domain through HTTPS URL parsing, including IDNA conversion. It must pass the declaration-host checks above, and every ASCII domain label must be 1–63 letters, digits or hyphens, without a leading or trailing hyphen. The full normalized mailbox must be at most 254 UTF-16 code units. Preserve local-part case and plus tags; normalize the domain to its URL hostname.

Compute the registrable domain of the final app page hostname and normalized email hostname using the Public Suffix List, including its PRIVATE section. Both must exist and be equal. Thus app.example.co.uk and mail.example.co.uk share authority; alice.github.io and bob.github.io do not. Compare against the final app page, never its manifest CDN or HTML base. Suffix-list data is an implementation dependency that may be updated; record the deployed list/library version when reproducibility for changing suffixes is needed.

A match is a domain-consistency check and does not verify mailbox ownership. Build the result URL as mailto: plus the normalized mailbox. There are no extra recipients, display names, headers, subject or message body.

Conformance examples

In the vectors below, omitted pageURL means https://app.example.co.uk/pwa/, and the manifest URL is always https://cdn.other.net/manifest.json. Omitted HTML is empty. A manifest object, when present, replaces the object otherwise made from support. Each expected value is the complete selected support result. All addresses are illustrative test inputs; no network requests or emails are needed.

[
  {
    "name": "absolute help URL",
    "support": "https://support.example.com/help",
    "expected": {
      "url": "https://support.example.com/help",
      "kind": "web",
      "source": "support"
    }
  },
  {
    "name": "manifest-relative help URL",
    "support": "/help",
    "expected": {
      "url": "https://cdn.other.net/help",
      "kind": "web",
      "source": "support"
    }
  },
  {
    "name": "same registrable email domain",
    "support": "mailto:Support+app@mail.EXAMPLE.co.uk",
    "expected": {
      "url": "mailto:Support+app@mail.example.co.uk",
      "kind": "email",
      "email": "Support+app@mail.example.co.uk",
      "source": "support"
    }
  },
  {
    "name": "valid manifest wins",
    "html": "<link rel=\"help\" href=\"/html-help\"><script type=\"application/ld+json\">{\"@type\":\"WebApplication\",\"softwareHelp\":\"https://example.co.uk/schema-help\"}</script>",
    "support": "mailto:help@example.co.uk",
    "expected": {
      "url": "mailto:help@example.co.uk",
      "kind": "email",
      "email": "help@example.co.uk",
      "source": "support"
    }
  },
  {
    "name": "invalid manifest falls back to JSON-LD",
    "html": "<link rel=\"help\" href=\"/html-help\"><script type=\"application/ld+json\">{\"@type\":\"WebApplication\",\"softwareHelp\":\"https://example.co.uk/schema-help\"}</script>",
    "support": "mailto:help@other.co.uk",
    "expected": {
      "url": "https://example.co.uk/schema-help",
      "kind": "web",
      "source": "Schema.org softwareHelp"
    }
  },
  {
    "name": "HTML help resolves against valid HTML base",
    "html": "<base href=\"https://docs.example.com/base/\"><link rel=\"help\" href=\"help\">",
    "expected": {
      "url": "https://docs.example.com/base/help",
      "kind": "web",
      "source": "HTML rel=\"help\""
    }
  },
  {
    "name": "HTML base cannot authorize another email domain",
    "html": "<base href=\"https://other.net/\">",
    "support": "mailto:help@other.net",
    "expected": null
  },
  {
    "name": "bare mailbox",
    "support": "help@example.co.uk",
    "expected": null
  },
  {
    "name": "email headers",
    "support": "mailto:help@example.co.uk?subject=Hello",
    "expected": null
  },
  {
    "name": "encoded email headers",
    "support": "mailto:help@example.co.uk%0d%0aBcc:other@example.com",
    "expected": null
  },
  {
    "name": "different shared-hosting tenant",
    "pageURL": "https://alice.github.io/",
    "support": "mailto:help@bob.github.io",
    "expected": null
  },
  {
    "name": "internationalized domain",
    "pageURL": "https://app.xn--bcher-kva.de/",
    "support": "MAILTO:Help%2Bapp@BÜCHER.de",
    "expected": {
      "url": "mailto:Help+app@xn--bcher-kva.de",
      "kind": "email",
      "email": "Help+app@xn--bcher-kva.de",
      "source": "support"
    }
  },
  {
    "name": "legacy alias is ignored",
    "manifest": {
      "support_url": "https://example.co.uk/help"
    },
    "expected": null
  },
  {
    "name": "malformed JSON-LD falls back to HTML",
    "html": "<script type=\"application/ld+json\">{broken</script><link rel=\"help\" href=\"/help\">",
    "expected": {
      "url": "https://app.example.co.uk/help",
      "kind": "web",
      "source": "HTML rel=\"help\""
    }
  },
  {
    "name": "JSON-LD URL object",
    "html": "<script type=\"application/ld+json\">{\"@type\":\"https://schema.org/SoftwareApplication\",\"softwareHelp\":{\"@id\":\"/support\"}}</script>",
    "expected": {
      "url": "https://app.example.co.uk/support",
      "kind": "web",
      "source": "Schema.org softwareHelp"
    }
  }
]

Use and provenance

The implementation and its existing support tests were checked against all 15 vectors before publication. The convention is used by PWA Help's publisher-support display and public metadata API. Other consumers can implement it independently and cite this exact version. Do not present a discovered support address as verified identity, endorsement, an installation guarantee or permission to send a message.

Publisher documentation: https://pwahelp.org/publishers

Reuse

The publisher dedicates this publication to the public domain under CC0 1.0 Universal.