From 4f1335242cbb969f956b316c69562363646781d7 Mon Sep 17 00:00:00 2001 From: Timo <6156589+Shik3i@users.noreply.github.com> Date: Mon, 29 Jun 2026 13:35:34 +0200 Subject: [PATCH 1/8] feat(extension): add shared title privacy modes --- docs/CHANGELOG.md | 7 ++ docs/HOW_IT_WORKS.md | 4 +- docs/PRIVACY.md | 2 +- docs/branch-scope-issue-13-title-privacy.md | 41 +++++++ extension/background.js | 123 ++++++++++++++++---- extension/locales/de.json | 7 +- extension/locales/en.json | 7 +- extension/locales/es.json | 7 +- extension/locales/fr.json | 7 +- extension/locales/it.json | 7 +- extension/locales/ja.json | 7 +- extension/locales/ko.json | 7 +- extension/locales/nl.json | 7 +- extension/locales/pl.json | 7 +- extension/locales/pt-BR.json | 7 +- extension/locales/pt.json | 7 +- extension/locales/ru.json | 7 +- extension/locales/tr.json | 7 +- extension/locales/uk.json | 7 +- extension/locales/zh.json | 7 +- extension/popup.html | 9 ++ extension/popup.js | 12 +- extension/title-privacy.js | 35 ++++++ scripts/test-title-privacy.mjs | 52 +++++++++ scripts/verify-release.mjs | 1 + 25 files changed, 347 insertions(+), 44 deletions(-) create mode 100644 docs/branch-scope-issue-13-title-privacy.md create mode 100644 extension/title-privacy.js create mode 100644 scripts/test-title-privacy.mjs diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e106a17..35ba985 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to the KoalaSync browser extension and relay server. --- +## Unreleased + +### Added +- **Extension: Shared title privacy setting** - Advanced users can now choose whether KoalaSync shares full tab/media titles, only detected episode identifiers such as `S01E04`, or no shared titles at all. The default remains full titles for backwards compatibility. + +--- + ## [v2.5.0] — 2026-06-29 ### Added diff --git a/docs/HOW_IT_WORKS.md b/docs/HOW_IT_WORKS.md index 7aec053..46f8a94 100644 --- a/docs/HOW_IT_WORKS.md +++ b/docs/HOW_IT_WORKS.md @@ -156,7 +156,7 @@ While in a room, two heartbeats keep the session alive: | Heartbeat | Interval | Source | Purpose | |:----------|:---------|:-------|:--------| | **Background** | 30 seconds | `background.js` | While connected, signals "I'm still connected" and triggers automatic reconnect (500ms base, max 5s). No heartbeats fire when idle (lazy connect). | -| **Content** | 15 seconds | `content.js` | Sends video metadata: `currentTime`, `mediaTitle`, `playbackState`, `volume`, `muted` | +| **Content** | 15 seconds | `content.js` | Sends video metadata: `currentTime`, privacy-filtered `mediaTitle`, `playbackState`, `volume`, `muted` | - **Server Reaper**: Every 2 minutes, the server checks for peers with no activity for 5+ minutes and disconnects them ("dead peer pruning"). - **Room Cleanup**: Empty rooms are deleted immediately. Inactive rooms are pruned after 2 hours. @@ -184,7 +184,7 @@ When a user clicks **"Leave"** or closes their browser: When watching a series and an episode ends: 1. `content.js` monitors the [Media Session API](https://developer.mozilla.org/en-US/docs/Web/API/Media_Session_API) for title changes. -2. When a new title is detected, the peer broadcasts `EPISODE_LOBBY` with the expected new title. +2. When a new title is detected, the peer broadcasts `EPISODE_LOBBY` with the expected title after applying the local Shared Titles privacy setting. In episode-only mode this is an identifier such as `S01E04`; in hidden mode the client does not create a new episode lobby. 3. All peers' videos freeze. The UI shows an "Episode Lobby" card with peer readiness status. 4. Each peer's `content.js` polls for the new title to appear in the `