This information is intended for those who want to make their own custom site mappings, containing the entire schema.
Quick reference
A full mapping is a single JSON object:origin is strictly required. Every other field has a default or is optional.
Identity
origin — required
The site’s origin.
extraDomains — optional
Additional origins capped at 9 entries that resolve to the same mapping. Useful when a site uses a separate domain for its player (an aggregator at aggregator.example whose player lives at cdn-player.example), or uses multiple domains for i.e. seperating regions.
Path matching
includePathGlobs — optional
The mapping is only active when the URL path matches at least one glob. Omit the field (or use an empty array) to match every path.
*is the only wildcard.- Matches are case-insensitive.
excludePathGlobs — optional
Same shape as includePathGlobs, but the opposite effect: if any pattern matches, the mapping is skipped even when an includePathGlobs entry also matched.
Display
display — required
How the comments section renders on the page. One of these strings:
Icon-button fields
Only consulted when"display": "icon". All three are optional.
sidePadding — optional
Horizontal padding (in pixels) applied to the mount target. Useful when the mount point would otherwise sit flush against the page edge.
0.
commentsBackgroundColor — optional
Base CSS color for the comments surface. Hayami derives a full palette (surface, borders, text contrast, icon filter, …) from this single value.
rgb(...), rgba(...), hsl(...), hsla(...), and named colors. Empty strings are dropped from the saved mapping.
Anchor and mount points
The two selectors below tell Hayami where on the page the comments belong. Their roles depend on thedisplay value:
anchorSelector — required
mountSelector — required
anchorXPath / mountXPath — optional
XPath fallbacks for the two selectors above. When set alongside the CSS version, the CSS selector is tried first; XPath is consulted only when the CSS selector returns no element.
Single-page detection
These fields describe how to extract the anime name and episode label from a page that contains both pieces of information.Title
English Title from a heading shaped Japanese Title / English Title.
Episode
Release date
Episode list (offset detection)
Some sites label episodes cumulatively across cours (showing episodes 25–30 for “Cour 3”) while discussion sources key threads to per-cour numbering (1–6 for the same cour). When that mismatch exists, Hayami uses these fields to enumerate the page’s visible range and apply an offset.
If
episodeListItemRegex is omitted, Hayami tries these patterns in order, taking the first hit:
\b(?:Episode|Ep\.?|EP)\s*[:#-]?\s*(\d{1,4})\b— explicit “Episode N”, “Ep N”, “EP-N”^\s*(\d{1,4})\.\s+— “1. Episode title”^\s*(\d{1,4})\s*$— bare number^\s*(\d{1,4})(?=\s|-|:|\.|\||$)— leading number with separator
Cross-page mappings
For sites that split anime metadata and the actual player across two URLs — often two different domains — use the optionalepisodeIndex and episodeKey blocks.
An index/detail page lists every episode with a unique key embedded in each entry (a URL hash, an ID, a slug). Clicking an episode opens a player page whose URL carries that same key. Hayami snapshots { key: episodeNumber } from the index, then resolves the player page by reading its own key out of the URL.
episodeIndex — optional
Configured on the index page half of the mapping. Walks the playlist and persists a per-episode snapshot keyed by mapping origin.
If
itemSelector and itemXPath are both empty, the whole block is dropped during validation.
Snapshots are deduped by signature, so SPA observer ticks that re-extract the same playlist write to storage exactly once.
episodeKey — optional
Configured on the player page half. Reads a key from the current URL (or DOM) and looks it up in the snapshot.
At least one of
fromLocation, selector, or xPath must be set. If all three are empty, the block is dropped.
