Skip to content

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 ​

  1. Download the prebuilt zip from touched-page/extension (or directly from your node at /extension.zip) and unzip it.
  2. Open chrome://extensions (or edge://extensions), enable Developer mode, and click Load unpacked pointing at the unzipped folder.
  3. Click the touched.page icon 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 your touched-node OWNER_KEY.
  4. 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.json directly (falling back automatically to your node's GET /api/extension/rules/starter.json when GitHub is unreachable).
  • Starter Pack v1.2.0 (14 rules across 12 cross-medium sites, each with a declarative circular platform badge): 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) ​

ConstraintLimit
Rules per packMax 100 rules
JSON file sizeMax 512 KB (524,288 bytes UTF-8)
Regular expressionsMax 200 chars per pattern; nested quantifiers (ReDoS patterns) rejected
Host matchingExplicit hostnames only (<all_urls> and bare * rejected)
JSON-LD pathsSafe dot-paths only (__proto__, prototype, constructor forbidden)
Declarative badgeOptional { 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 isolationAny failed extraction step falls through gracefully to the next step

Minimal Working Rule Example (Letterboxd) ​

json
{
  "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" (video maps to screen, music maps to audio).
  • externalId.from: "path" | "query" | "selector" | "meta" — paired with namespace to form the portable namespace:externalId work key.
  • canonicalUrlTemplate: Supports {id} (extracted externalId), {host}, and $1 (first capture group of pathPattern).
  • badge (optional, introduced in v1.2.0): Strict declarative circular source badge { label, bg, fg, icon? }. icon accepts 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 for title (required), originalTitle, localizedTitles, cover, creator, releaseYear, and subtype.
  • 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) any https:// 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 unverified source_refs strictly 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.

site-rules.json2.1 KB / 512 KB
Security Check, Badge Preview & MatcherSafe & Valid · 2 rule(s)
Matches extension-store CI checks: zero remote JS, ReDoS-safe regex, concrete hosts, safe declarative badge, and safe JSON-LD.
Live Declarative Circular Badge Preview
steamST · #132E53
bangumiBG · #F09199
Sample URL Match Result
Matched Rulesteam-app
Source Keysteam:632470
Categorygame · pc
Canonicalhttps://store.steampowered.com/app/632470/
extension-store registry.json PR Snippet
{
  "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:

  1. Draft & test locally: Save your touched.page/site-rules/v1 JSON file, import it in the extension's Site Rules panel, open a real work page on that site, and click Test current page to verify externalId, title, and cover.
  2. Host the JSON: Commit the pack to a public GitHub repo (or GitHub Gist) and grab its https://raw.githubusercontent.com/... URL.
  3. Open a 10-line PR to touched-page/extension-store: Add one entry to registry.json:
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.

Open-core ecosystem under MIT License. Built around works, writing, and data sovereignty.