Browser Extension & Rule Store Co-Creation
The touched-page/extension Manifest V3 extension turns any game, anime, book, movie, or album page in Chrome, Edge, Arc, or Brave into a 1-click capture panel connected to https://touched.page or your self-hosted touched-node.
1. Install & Connect the MV3 Extension
- Download the prebuilt zip from
touched-page/extension(or directly from your node at/extension.zip) and unzip it. - Open
chrome://extensions(oredge://extensions), enable Developer mode, and click Load unpacked pointing at the unzipped folder. - Click the
touched.pageicon to open connection settings:- Server URL:
https://touched.page(or your self-hosted node domain, e.g.https://library.example.com, with no trailing slash). - API Key: A scoped
tp_live_...key (read:self+mark:write) from/settings, or yourtouched-nodeOWNER_KEY.
- Server URL:
- Click Verify Connection. Open any supported work page (Steam, Douban, Bangumi, VNDB, TMDB, Letterboxd, Goodreads, Qidian, etc.) to capture, rate, tag, link multiple platform sources, and edit your review in place.
2. One-Click Community Rule Store
Open the Site Rules panel inside the extension to browse the built-in Rule Store, backed by touched-page/extension-store:
- Fetches
https://raw.githubusercontent.com/touched-page/extension-store/main/registry.jsondirectly (falling back automatically to your node'sGET /api/extension/rules/starter.jsonwhen GitHub is unreachable). - Starter Pack v1.2.0 (
14rules across12cross-medium sites, each with a declarative circular platformbadge): Letterboxd, MyAnimeList (anime & manga), Goodreads, HowLongToBeat, TapTap, IGDB, Qidian, TMDB (movies & TV), Bilibili Bangumi, WeRead, RateYourMusic, and MusicBrainz. - You can also subscribe to any custom HTTPS raw JSON rule pack URL or import local JSON directly.
3. Declarative Rule Format (touched.page/site-rules/v1)
Rule packs contain declarative JSON only—CSS selectors, HTML attributes (including <meta> tags), safe JSON-LD dot paths, and bounded regular expressions. There is zero remote JavaScript, no eval, and no new Function, staying 100% compliant with Chrome Web Store Manifest V3 policies.
Security Constraints (Enforced on Import & CI)
| Constraint | Limit |
|---|---|
| Rules per pack | Max 100 rules |
| JSON file size | Max 512 KB (524,288 bytes UTF-8) |
| Regular expressions | Max 200 chars per pattern; nested quantifiers (ReDoS patterns) rejected |
| Host matching | Explicit hostnames only (<all_urls> and bare * rejected) |
| JSON-LD paths | Safe dot-paths only (__proto__, prototype, constructor forbidden) |
Declarative badge | Optional { label, bg, fg, icon? } — label 1–3 ASCII chars (/^[A-Za-z0-9.+]{1,3}$/), bg/fg 6-digit hex, icon from 17 allowlisted keys; zero raw <svg>, HTML, URLs, or extra keys |
| Failure isolation | Any failed extraction step falls through gracefully to the next step |
Minimal Working Rule Example (Letterboxd)
{
"protocol": "touched.page/site-rules/v1",
"id": "example-letterboxd",
"name": "Letterboxd Films",
"version": "1.0.0",
"rules": [
{
"id": "letterboxd-film",
"name": "Letterboxd Film",
"namespace": "letterboxd",
"hosts": ["letterboxd.com", "www.letterboxd.com"],
"pathPattern": "^/film/([a-z0-9-]+)/?$",
"category": "video",
"subtype": "movie",
"badge": {
"label": "LB",
"bg": "#14181C",
"fg": "#00E054",
"icon": "film"
},
"externalId": {
"from": "path",
"pattern": "^/film/([a-z0-9-]+)/?$",
"group": 1
},
"canonicalUrlTemplate": "https://letterboxd.com/film/{id}/",
"extract": {
"title": [
{ "selector": "h1.headline-1" },
{ "jsonLdPath": "name" },
{ "selector": "meta[property=\"og:title\"]", "attr": "content" }
],
"originalTitle": [
{ "selector": "h2.originalname" }
],
"cover": [
{ "jsonLdPath": "image" },
{ "selector": "meta[property=\"og:image\"]", "attr": "content" }
],
"creator": [
{ "jsonLdPath": "director.0.name" }
],
"releaseYear": [
{ "jsonLdPath": "releasedEvent.0.startDate", "regex": "(\\d{4})", "group": 1 }
]
}
}
]
}Field Reference
category:"game" | "book" | "video" | "music" | "other"(videomaps toscreen,musicmaps toaudio).externalId.from:"path" | "query" | "selector" | "meta"— paired withnamespaceto form the portablenamespace:externalIdwork key.canonicalUrlTemplate: Supports{id}(extractedexternalId),{host}, and$1(first capture group ofpathPattern).badge(optional, introduced inv1.2.0): Strict declarative circular source badge{ label, bg, fg, icon? }.iconaccepts one of 17 built-in keys (steam,bangumi,douban,bilibili,vndb,tmdb,qidian,weread,dlsite,fanza,spotify,netease,game,film,book,music,globe). Iconic keys render crisp monochrome vectors; other keys render centered monograms. Raw SVG strings, HTML, CSS URLs, and unknown keys are rejected at import and CI.extract: Ordered fallback arrays fortitle(required),originalTitle,localizedTitles,cover,creator,releaseYear, andsubtype.- Resolution priority: legacy custom rules -> built-in rules -> enabled declarative rule packs -> Open Graph fallback.
4. Verified Public Domains Gate
touched.page uses a two-layer domain boundary so personal libraries stay unrestricted while public pages stay clean and spam-free:
- Personal Library (Zero Restriction): You can capture, link, click, edit, and export (
/api/me/export.json) anyhttps://URL—private trackers, indie stores, personal notes, or niche catalogs. Non-verified links are clearly labeled Personal link (仅自己可见) in Work Editor -> Media & Sources. - Public Surfaces & WorkDB Aggregation (Verified Only): Public work pages (
/works/:id), visitor library views,/@handle/touched.json, and<touched-work-card>emit only Verified catalog/store links (from the official Starter Pack + curated media databases). WorkDB never merges or cross-user-aggregates unverified domains, scoping unverifiedsource_refsstrictly to the owner who saved them.
Interactive Rule Pack Validator & URL Tester
Validate any touched.page/site-rules/v1 pack (including v1.2.0 declarative circular badge fields) against the exact ReDoS, concrete-host, size, and zero-JS rules enforced by touched-page/extension-store CI, preview circular badges live, test sample work URLs, and copy a ready-to-submit registry.json PR snippet.
steam-appsteam:632470game · pchttps://store.steampowered.com/app/632470/{
"id": "steam-bangumi-sample",
"name": "Steam & Bangumi Sample Pack",
"description": "Sample declarative capture rules with v1.2.0 circular badges.",
"author": "your-github-handle",
"repository": "https://github.com/your-github-handle/steam-bangumi-sample",
"packUrl": "https://raw.githubusercontent.com/your-github-handle/steam-bangumi-sample/main/rules.json",
"sites": [
"Steam Store App",
"Bangumi Subject"
],
"categories": [
"game",
"video"
],
"tags": [
"community"
],
"license": "MIT",
"version": "1.2.0"
}Submit a Site Rule PR
Adding support for a niche literature site, podcast directory, indie game store, or local database takes ten minutes:
- Draft & test locally: Save your
touched.page/site-rules/v1JSON file, import it in the extension's Site Rules panel, open a real work page on that site, and click Test current page to verifyexternalId,title, andcover. - Host the JSON: Commit the pack to a public GitHub repo (or GitHub Gist) and grab its
https://raw.githubusercontent.com/...URL. - Open a 10-line PR to
touched-page/extension-store: Add one entry toregistry.json:
{
"id": "my-community-pack",
"name": "My Site Rules",
"description": "One-click capture rules for Site A and Site B.",
"author": "your-github-handle",
"repository": "https://github.com/you/your-rules-repo",
"packUrl": "https://raw.githubusercontent.com/you/your-rules-repo/main/rules.json",
"sites": ["Site A", "Site B"],
"categories": ["book", "game"],
"tags": ["community"],
"license": "MIT",
"version": "1.0.0"
}GitHub Actions in extension-store automatically fetches your packUrl, validates schema + security limits (size, regex safety, explicit hosts), and once merged your pack becomes 1-click installable for every touched.page and touched-node user worldwide.