chore(web): page views via our Shynet instance (page only, not the userscript panel)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e0bd630bb6
commit
91d32352e4
4 files changed
+23
No files matched your search
@@ -61,6 +61,7 @@ requests) and smoke-tests it. Example deployment: `docker-compose.example.yml`.
|
||||
| Webtoons HTML / `swebtoon-phinf.pstatic.net` | server proxy or `GM_xmlhttpRequest` | Nothing works. |
|
||||
| Wayback (`web.archive.org`) | same | Warning; current covers only. |
|
||||
| Server storage (folder on our server) | server | `server` host hidden; litterbox/catbox/direct still work. |
|
||||
| Shynet (`analytics.lucaswinther.info`) | `<script>` on the page only | No page-view counts; nothing else changes. |
|
||||
| litterbox / catbox | browser directly (litterbox), server or `GM_xmlhttpRequest` (catbox) | That host fails; others still work. |
|
||||
|
||||
## Invariants
|
||||
|
||||
@@ -16,6 +16,16 @@ the repo every session — measurably slower and more tokens).
|
||||
**Consequences:** Rule changes happen in one file; pointer files must stay thin. Plans are working
|
||||
artefacts: kept after merge they go stale and contradict the code, so the spec is the record.
|
||||
|
||||
## 2026-10-15 — Page views via our Shynet instance
|
||||
**Status:** accepted
|
||||
**Context:** The user asked for analytics from their self-hosted Shynet.
|
||||
**Decision:** Shynet's snippet (deferred script plus `<noscript>` pixel) at the end of the page's `<body>`
|
||||
(`src/web/index.html`). The userscript panel is not tracked: mangabaka.org isn't ours to measure.
|
||||
**Alternatives:** none considered; the user named the tool.
|
||||
**Consequences:** A third-party script runs on the page's origin, so it could read `localStorage`, including a
|
||||
MangaBaka token saved with "Remember on this device". It is the user's own instance; anyone pointing the page at
|
||||
another analytics host must keep that in mind.
|
||||
|
||||
## 2026-10-15 — Tapas source (spec 003)
|
||||
**Status:** accepted
|
||||
**Context:** The user asked for tapas.io next; comics and novels (chosen in chat).
|
||||
|
||||
@@ -10,5 +10,10 @@
|
||||
</head>
|
||||
<body class="mbseed-page">
|
||||
<div id="app"></div>
|
||||
<!-- Page views, self-hosted Shynet (the page only; the userscript panel isn't tracked). -->
|
||||
<noscript>
|
||||
<img src="https://analytics.lucaswinther.info/ingress/2c42f566-eee1-499e-99b8-0e9d2a4cb5da/pixel.gif" alt="">
|
||||
</noscript>
|
||||
<script defer src="https://analytics.lucaswinther.info/ingress/2c42f566-eee1-499e-99b8-0e9d2a4cb5da/script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,3 +9,10 @@ test("every element app.ts looks up exists in the template exactly once", async
|
||||
expect({ id, count: APP_HTML.split(`id="${id}"`).length - 1 }).toEqual({ id, count: 1 });
|
||||
}
|
||||
});
|
||||
|
||||
test("analytics: on the page only, never in the panel the userscript mounts on mangabaka.org", async () => {
|
||||
const page = await Bun.file("src/web/index.html").text();
|
||||
expect(page).toContain('<script defer src="https://analytics.lucaswinther.info/ingress/');
|
||||
expect(APP_HTML).not.toContain("analytics");
|
||||
expect(await Bun.file("src/userscript/main.ts").text()).not.toContain("analytics");
|
||||
});
|
||||
Reference in new issue
Block a user