Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
c8c40da
feat(rules): add regex UriRule engine and automatic legacy config mig…
Bluscream Aug 20, 2026
bfe256c
feat(ui): add Rules DataGrid tab, EditRule modal, DataGrid Fluent the…
Bluscream Aug 20, 2026
ac0e17e
feat(ui): add unsaved changes confirmation dialog for rules tab navig…
Bluscream Aug 20, 2026
b37e3f7
feat(cache): add Open File and Copy File Path buttons in front of Ope…
Bluscream Aug 20, 2026
b643f48
style(dashboard): consolidate yt-dlp, Deno, and FFmpeg status into a …
Bluscream Aug 20, 2026
09af364
fix(patching): change Log.Error to Log.Warning when VRChat yt-dlp pat…
Bluscream Aug 20, 2026
f5585f7
fix(config): add UriRules & GetDefaultRules to ConfigModel and change…
Bluscream Aug 20, 2026
342f7f6
fix(patching): guard localLowPath null check and wrap patch/restore i…
Bluscream Aug 20, 2026
84a4aef
style(cache): remove Open File button and place Copy File Path after …
Bluscream Aug 20, 2026
ac06076
feat(dashboard): add Video Players toggle card to block/unblock in-ga…
Bluscream Aug 20, 2026
01dbeb0
feat(rules): add default rules for MightyGym, IlluminationMedia, and …
Bluscream Aug 20, 2026
f066340
feat(rules): add Rewrite rule action type and default rules for Dropb…
Bluscream Aug 20, 2026
a6febf6
docs: update README with VRCVideoCacherPlusPlus features and fix Fire…
Bluscream Aug 20, 2026
d00905d
build(extension): add pre-built Firefox extension zip with data_colle…
Bluscream Aug 20, 2026
4247fb8
style(dashboard): rename video player toggle button to Enable / Disable
Bluscream Aug 20, 2026
c34c368
fix(api): route all incoming video requests through RuleEngine instea…
Bluscream Aug 20, 2026
3e62b34
refactor(api): replace legacy domain-specific cache boolean checks wi…
Bluscream Aug 20, 2026
67c9288
style(settings): replace redundant domain cache controls with pointer…
Bluscream Aug 20, 2026
64e5f6e
fix(api): queue downloads strictly when final RuleAction is Cache
Bluscream Aug 20, 2026
1f0cd3d
feat(diagnostics): add global exception handlers and automatic CRASH_…
Bluscream Aug 20, 2026
660532a
chore(release): bump version to 2026.8.20
Bluscream Aug 20, 2026
f1cb66b
feat(ui): add Rules navigation button and ViewModel binding to MainWi…
Bluscream Aug 20, 2026
e0de3c0
feat(loc): sync all updated translation keys and add MOTD parser & VV…
Bluscream Aug 20, 2026
596e818
feat(loc): bind all newly added UI elements and dialogs to localizati…
Bluscream Aug 20, 2026
4436865
feat(loc): organize Rules & UI enhancement keys into dedicated sectio…
Bluscream Aug 20, 2026
93e9a2c
fix(ui): dynamic TargetUrlLabel for Rewrite action ('Target Rewrite P…
Bluscream Aug 20, 2026
cc0931a
style(loc): clean up top duplicate key definitions and move Rules & n…
Bluscream Aug 20, 2026
1803b63
fix(ui): restore PreCacheVideos localization keys, migrate legacy blo…
Bluscream Aug 20, 2026
5533169
feat(ui): add red Defaults button with refresh icon and confirmation …
Bluscream Aug 20, 2026
65f380e
refactor(ui): use native PopupWindow.CreateConfirm dialog for rule re…
Bluscream Aug 20, 2026
8c376a2
fix(ui): include Avalonia.Controls.DataGrid Fluent theme in App.axaml…
Bluscream Aug 20, 2026
61a2fe4
Update README.md
Bluscream Aug 20, 2026
ea5d5fa
refactor(config): integrate UriRules into PlusConfigManager, evaluate…
Bluscream Aug 20, 2026
24277f5
Refactor Rules System: bind site integrations dynamically and add Res…
Bluscream Aug 21, 2026
d8c9f96
Bump version to 2026.8.21
Bluscream Aug 21, 2026
e0eed8e
Add flash and fade animation to rules list when a rule is matched
Bluscream Aug 21, 2026
741296c
Display Integration column value as an asterisk
Bluscream Aug 21, 2026
139c887
Update Integration column header to 'I' with a width of 35
Bluscream Aug 21, 2026
15f25b0
Update Active column header to checkmark emoji with a width of 35
Bluscream Aug 21, 2026
b0b9b45
Refactor actions column to use a 3-dot MenuFlyout context dropdown
Bluscream Aug 21, 2026
3936260
fix(updater): point self-update at this fork instead of upstream
Bluscream Aug 21, 2026
5cbe279
fix(updater): honour the AutoUpdateVrcVideoCacher setting
Bluscream Aug 21, 2026
706f809
fix(rules): repair the Dropbox share rewrite for modern link formats
Bluscream Aug 21, 2026
8272336
fix(download): stop capping direct cache downloads at 100 seconds
Bluscream Aug 21, 2026
b894bbb
fix(api): make Block actually block instead of falling through to pla…
Bluscream Aug 21, 2026
552f5c2
fix(process): drain stdout and stderr concurrently to avoid deadlocks
Bluscream Aug 21, 2026
6087198
fix(rules): make the unsaved-changes guard actually guard
Bluscream Aug 21, 2026
4fab423
fix(youtube): url-encode the oEmbed target so title lookups work
Bluscream Aug 21, 2026
2b704a6
fix(hosts): stop throwing on a hand-edited hosts file
Bluscream Aug 21, 2026
476948b
fix(robustness): guard file and URL operations that could abort startup
Bluscream Aug 21, 2026
06fea97
fix(logging): initialise the logger before anything that logs
Bluscream Aug 21, 2026
f5a815d
fix(args): preserve launch flags across an in-place update
Bluscream Aug 21, 2026
646d882
fix(i18n): survive an unknown language and fall back for missing keys
Bluscream Aug 21, 2026
512397f
fix(security): prevent zip-slip when extracting downloaded tool archives
Bluscream Aug 21, 2026
f590fba
fix(security): validate pre-cache manifest entries before writing them
Bluscream Aug 21, 2026
7584ae3
feat(security): verify downloaded tool binaries against their GitHub …
Bluscream Aug 21, 2026
fa94008
fix(security): pass yt-dlp arguments via ArgumentList instead of a co…
Bluscream Aug 21, 2026
6a5eaf2
fix(security): restrict cookie-endpoint CORS to the origins that need it
Bluscream Aug 21, 2026
db3a56b
fix(security): close the browser-driven SSRF path and block link-loca…
Bluscream Aug 21, 2026
36cea99
fix(db): keep EnableSensitiveDataLogging out of release builds
Bluscream Aug 21, 2026
6cc944c
fix(elevation): pass the executable path as an argument, not as text
Bluscream Aug 21, 2026
8181a20
docs: document every host the app connects to
Bluscream Aug 21, 2026
d964dfd
refactor(config): break the ConfigManager/CacheManager initialisation…
Bluscream Aug 21, 2026
6cb44c6
fix(cache): stop deleting non-video files from the cache directory
Bluscream Aug 21, 2026
72b12fd
fix(config): write config files atomically
Bluscream Aug 21, 2026
85482bb
refactor(download): fix blocking sleep and manual response disposal
Bluscream Aug 21, 2026
842a0ca
fix(download): report resume progress against the whole file
Bluscream Aug 21, 2026
f4b1017
refactor(lifecycle): make background loops observe a shutdown token
Bluscream Aug 21, 2026
7257f61
fix(cache): don't evict a file that is being written or published
Bluscream Aug 21, 2026
328d444
fix(db): close read-then-write races in the queue and watch stats
Bluscream Aug 21, 2026
bc2fcdb
feat(about): display the message of the day
Bluscream Aug 21, 2026
49e10c6
fix(config-api): use Newtonsoft's mapping attributes, not System.Text…
Bluscream Aug 21, 2026
58212a0
refactor(settings): remove the dead RedirectVRDancing toggle
Bluscream Aug 21, 2026
0a9e3b0
refactor(settings): remove the half-deleted BlockedUrls feature
Bluscream Aug 21, 2026
537654e
refactor(api): remove the unused HttpClient from ApiController
Bluscream Aug 21, 2026
6107ced
refactor(tracker): collapse the single-entry stream dictionary to one…
Bluscream Aug 21, 2026
1effd17
refactor: clear out assorted dead and duplicated code
Bluscream Aug 21, 2026
3f5ab5c
perf(rules): cache compiled rule regexes and pin them to invariant ca…
Bluscream Aug 21, 2026
a176910
refactor(resolve): pick the yt-dlp handler from UrlType, not a second…
Bluscream Aug 21, 2026
10223ac
refactor(rewrite): keep cloud share-link rewriting in the rules only
Bluscream Aug 21, 2026
fe7cfd8
fix(rules): stop resurrecting default rules the user deleted
Bluscream Aug 21, 2026
049beb4
fix(ui): stop the error-popup storm
Bluscream Aug 21, 2026
777d18f
fix(settings): apply patch toggles immediately, flag the cache path a…
Bluscream Aug 21, 2026
e5ed0db
fix(elevation): don't freeze the UI while the password prompt is open
Bluscream Aug 21, 2026
3a89530
fix(db): backfill columns the model declares but the database lacks
Bluscream Aug 21, 2026
d4ff45f
perf(ui): construct tab view models on first navigation
Bluscream Aug 21, 2026
10f4455
perf(startup): stop awaiting work nothing depends on
Bluscream Aug 21, 2026
7982b21
i18n: localize hardcoded UI strings and add keys used but never defined
Bluscream Aug 21, 2026
4bb141c
fix(links): route every external open through OpenUrl
Bluscream Aug 21, 2026
b90e185
build: stop the trimmer from stripping types only reflection can see
Bluscream Aug 22, 2026
ee22c13
ci: add a build, test and publish workflow
Bluscream Aug 22, 2026
ad94491
build: make build.sh overridable and its pkill targeted
Bluscream Aug 22, 2026
51bb731
test: cover the rules engine, video id parsing, validator and HLS par…
Bluscream Aug 22, 2026
fda80c7
build(extension): package from source and guard against copy drift
Bluscream Aug 22, 2026
3401991
chore: record the Avalonia.Diagnostics availability check
Bluscream Aug 22, 2026
c705db2
test: make the YouTube id tests async
Bluscream Aug 22, 2026
b2cb7a1
feat(downloads): report transfer rate and time remaining
Bluscream Aug 22, 2026
2bdbf36
refactor(json): move off Newtonsoft to System.Text.Json
Bluscream Aug 22, 2026
d2163c5
refactor(integrations): give each site its own folder and a real base…
Bluscream Aug 22, 2026
e4240e4
fix(pypydance): follow the CDN redirect so videos stop sharing one ca…
Bluscream Aug 22, 2026
0c60b89
refactor(config): share one Config.json with the original VRCVideoCacher
Bluscream Aug 22, 2026
5d82788
refactor(config): flatten config model and implement rolling backup w…
Bluscream Aug 22, 2026
f476dc2
revert(config): remove rolling backup/restore and migrations, keep fi…
Bluscream Aug 22, 2026
b42871c
chore: tag database and rule migrations with TODO Remove later comments
Bluscream Aug 22, 2026
982d3ba
build: update compiled yt-dlp-stub.exe
Bluscream Aug 22, 2026
ddc880d
build(extension): package Firefox XPI and Chrome CRX, stable private key
Bluscream Aug 22, 2026
d8a598b
feat(settings): add Show button to open settings folder in default fi…
Bluscream Aug 22, 2026
05c0b59
refactor: simplify show localizations, clean release zips, and empty …
Bluscream Aug 22, 2026
41615a5
feat(video-toggle): implement Block all Videos rule toggle and socket…
Bluscream Aug 22, 2026
3c66bdc
Add VRChat Log Monitor, Now Playing card view, and Active Connections…
Bluscream Aug 22, 2026
5b100f1
Refactor TrackVideoUrl into AssociateUrlInfo and match ActiveConnecti…
Bluscream Aug 22, 2026
75f01e8
Fix online cookie status validation check and add missing cookie expi…
Bluscream Aug 22, 2026
b7ace6b
Restore MOTD notification banner to Dashboard screen
Bluscream Aug 22, 2026
2900bc6
Remove MOTD card from About view
Bluscream Aug 22, 2026
8431500
Add dismiss button and SHA256 hash tracking for MOTD banner
Bluscream Aug 22, 2026
ac1734f
Fix Linux procfs socket inode resolution, unprivileged ss socket seve…
Bluscream Aug 22, 2026
4f3e454
Fix oEmbed lookup User-Agent to resolve video titles instantly on play
Bluscream Aug 22, 2026
94afd78
Implement direct ss -t -K IP socket severing with verbose diagnostic …
Bluscream Aug 22, 2026
30c5ae8
Add Firefox signature requirements to documentation and ensure releas…
Bluscream Aug 22, 2026
6005037
Convert about:* and chrome:* browser URLs into Markdown links in docu…
Bluscream Aug 22, 2026
776f051
Update README.md with all new user-facing features
Bluscream Aug 22, 2026
b10b551
Implement server-side HTTP video stream closing via ActiveStreamModul…
Bluscream Aug 22, 2026
e0926b3
Fix YouTube video playback format resolution with Android client fall…
Bluscream Aug 22, 2026
4383c3a
Integrate Vanara.PInvoke.IpHlpApi package for managed Windows socket …
Bluscream Aug 22, 2026
742dd20
Redesign Active Connections tab using Rules tab structure as skeleton
Bluscream Aug 22, 2026
a94dab1
Fix metadata fetch error popup by adding cookie-free fallback and fil…
Bluscream Aug 22, 2026
5c43810
fix(connections): stop reporting success for severing that never happ…
Bluscream Aug 22, 2026
9bd6aa2
fix(config): stop telling users about a backup file that is never cre…
Bluscream Aug 22, 2026
1897117
perf(resolve): stop retrying failures that no retry can fix
Bluscream Aug 22, 2026
e1b7419
Support IPv6 severing, elevated severing via polkit/UAC, and shutdown…
Bluscream Aug 22, 2026
6bcd691
Add a locale linter and turn build.sh into an ordered action pipeline
Bluscream Aug 22, 2026
ea99b1c
Add AGENTS.md and drop --restart from build.sh
Bluscream Aug 22, 2026
70863b1
Disable CI, build release artifacts locally, and add --stop/--start/-…
Bluscream Aug 22, 2026
b0741ba
Make --release build and attach the complete four-asset set, and docu…
Bluscream Aug 22, 2026
b7a9546
Rewrite the README for this fork, move assets off the code branch
Bluscream Aug 22, 2026
e36f20e
Match the repo's bare tag convention and keep stub churn out of relea…
Bluscream Aug 22, 2026
60a27cd
Release v2026.8.22
Bluscream Aug 22, 2026
8fe19d2
Make --release resume an interrupted upload instead of dead-ending
Bluscream Aug 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

# Disabled: GitHub Actions does not run on this account, so every push produced a failed
# run and a notification. Left in the repo rather than deleted because it still documents
# what a full check is, and it is one edit away from working again for anyone who forks.
#
# Everything below now runs locally instead β€” `./build.sh --lint` covers build-and-test
# and browser-extension, and `./build.sh --artifacts` covers publish. Re-enable by
# restoring the push/pull_request triggers:
#
# on:
# push:
# branches: [main]
# pull_request:
# workflow_dispatch:
on:
workflow_dispatch:

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Restore
run: dotnet restore VRCVideoCacher.sln

# The tree builds warning-free today; -warnaserror keeps it that way rather than
# letting warnings accumulate until nobody reads them.
- name: Build
run: dotnet build VRCVideoCacher.sln -c Debug --no-restore -warnaserror

- name: Test
run: dotnet test VRCVideoCacher.sln -c Debug --no-build --verbosity normal

browser-extension:
# chrome/ and firefox/ each have to contain their own copy of the shared files, so they
# can silently diverge when a fix lands in only one. This is the cheap guard against that.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check shared extension files
run: ./BrowserExtension/build.sh --check

- name: Check locales
run: python3 scripts/lint-locales.py

publish:
# PublishTrimmed only takes effect on publish, so build-and-test above never exercises
# it. This job is what would catch the trimmer removing something that only reflection
# reaches β€” a failure mode that cannot reproduce in a Debug build.
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rid: [win-x64, linux-x64]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'

- name: Publish ${{ matrix.rid }}
run: >
dotnet publish VRCVideoCacher/VRCVideoCacher.csproj
-c Release -r ${{ matrix.rid }}
-o out/${{ matrix.rid }}

- name: Package Zip Archive
run: |
cd out/${{ matrix.rid }}
zip -r ../../VRCVideoCacher-${{ matrix.rid }}.zip .

- uses: actions/upload-artifact@v4
with:
name: VRCVideoCacher-${{ matrix.rid }}.zip
path: VRCVideoCacher-${{ matrix.rid }}.zip
retention-days: 7
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ nul
/Build/linux-x64/VRCVideoCacher.pdb
/Build/linux-x64/yt-dlp-stub.exe
/Build/win-x64/VRCVideoCacher.pdb
notepad.md
notepad.md
output_linux_release/
output_steam_linux/
output_win_release/
VRCVideoCacher-*-x64.zip
# Browser extension packages (produced by BrowserExtension/build.sh)
/dist/
/out/
180 changes: 180 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# AGENTS.md

Fork of [codeyumx/VRCVideoCacherPlus](https://github.com/codeyumx/VRCVideoCacherPlus)
(itself a fork of EllyVR/VRCVideoCacher). .NET 10, Avalonia 12, EmbedIO, EF Core + SQLite,
Serilog. `upstream` remote points at codeyumx β€” keep merges from it possible.

## Build, check, release

There is no `dotnet` on the host; it lives in a distrobox container.

```bash
distrobox enter arch -- dotnet build VRCVideoCacher.sln -warnaserror
```

`build.sh` is the pipeline. Actions run in this order no matter what order they are
passed, any failure aborts the rest, and every dotnet call carries `-warnaserror`:

```
bump lint build artifacts stop deploy start commit push release
```

```bash
./build.sh --lint # locales, extension, strict compile, tests
./build.sh --build --stop --deploy --start # or --restart for the stop/start pair
./build.sh --all --dry-run # rehearse the whole release
```

Always `--lint` before committing.

**GitHub Actions does not run on this account.** `.github/workflows/ci.yml` is
disabled (`workflow_dispatch` only) because every push produced a failed run and a
notification. Its work happens locally instead β€” `--lint` is the build-and-test and
browser-extension jobs, `--artifacts` is the publish job. Do not re-enable the
triggers. Running the workflow under `act` was considered and rejected: it wants a
container runtime and a runner image to do what amounts to two `dotnet publish` calls.

**A release is always exactly four assets**: `VRCVideoCacher-win-x64.zip`,
`VRCVideoCacher-linux-x64.zip`, the Chrome `.crx` and the Firefox `.xpi`. `--release`
implies `--artifacts` so it builds them rather than trusting what is in `dist/`, and
both check the set is complete β€” the `.crx` is silently skipped when `npx` is missing,
which would otherwise ship a release with no Chrome download. The extension `.zip`
byproducts stay in `dist/` and are deliberately not attached.

`--artifacts` is also the only step that publishes Release/trimmed/single-file, so it
is the only one that exercises the trimmer. A Debug build cannot reproduce the trimmer
dropping something that only reflection reaches.

`dist/` is shared between `build.sh` and `BrowserExtension/build.sh`; neither may
`rm -rf` it, only its own outputs.

**Never stop, deploy to, or restart the app while the user has it running** unless
they asked for it in this session. Compiling and linting are always fine.

## Traps this codebase keeps setting

**The config file is shared with upstream VRCVideoCacher.** There is no separate
`PlusConfig.json` and no nested `Plus` block. Running plain VRCVideoCacher strips
keys it does not know, so every Plus setting must survive a round-trip through a
config that lost it β€” default sensibly, never assume presence.

**Localization fails silently.** English is the fallback, so a missing key renders
English and an empty one renders nothing. Add every new key to all eight
`Languages/*.loc.json`, then run `scripts/lint-locales.py`. Keys are often built at
runtime (`"SkipReasonTooLong|{0:F0}|{1}"`), so grep before assuming one is dead.

**`System.Text.Json` is source-generated.** A new serialized type needs a
`[JsonSerializable]` entry in `Utils/AppJsonContext.cs` or it fails at runtime, not
at compile time. No Newtonsoft anywhere.

**Exit code 0 does not mean success.** `ss -K` prints its header to stdout and
`SOCK_DESTROY answers: Operation not permitted` to stderr, then exits 0 β€” that is how
severing claimed success for years while doing nothing. Classify from the actual
output, and report "not permitted" as itself rather than as failure or success.

**`.NET` will not follow an HTTPS→HTTP redirect.** PyPyDance downgrades, so the
redirect has to be followed manually with a bounded hop count.

**Background loops must observe `Program.ShutdownToken`.** `Main` signals shutdown
and then force-exits; a loop that did not link its token is killed mid-step. Link,
do not replace: `CancellationTokenSource.CreateLinkedTokenSource(Program.ShutdownToken)`.

**Never block the UI thread.** Refresh loops use `PeriodicTimer` + `Task.Run` and
marshal only the finished result back. `DispatcherTimer` doing real work freezes the
window, and so does a synchronous `WaitForExit` on an elevation prompt.

**Use `ProcessStartInfo.ArgumentList`, never `Arguments`.** Install paths routinely
contain spaces (a Steam library on an external drive), and string interpolation
splits them into two arguments.

**Anything running elevated is a one-shot helper.** No UI, no config writes, no
background work; re-validate every argument (parse addresses as `IPAddress`) because
it runs as root. See `LaunchArgs.IsPrivilegedHelper`.

**`TimeSpan` normalizes instead of throwing.** `99:99` silently becomes 1h40m β€”
validate parsed fields explicitly.

**`yt-dlp-stub.exe` rebuilds non-deterministically.** It shows up dirty after any
build with identical content. `git checkout` it rather than committing the churn.

**Do not chain a check onto a build with `&&`.** `dotnet build && grep ...` tests the
grep, not the build. Use an explicit `if ... then ... else ... fi`.

**Sandbox live testing.** `XDG_CONFIG_HOME=/tmp/vvc-sandbox` keeps the user's real
config and cache database untouched.

## Telling the user something

Pick the quietest thing that does the job. In rough order of intrusiveness:

| Want | Use |
| --- | --- |
| Diagnostics, background progress | `Log.Debug` / `Log.Information` β€” Logs tab |
| Something degraded but recoverable | `Log.Warning` |
| A short result next to the thing it concerns | tab-local `StatusMessage` + `StatusMessageColor` |
| Persistent app-wide state | `MainWindowViewModel.StatusText` (status bar) |
| The user has to decide | `PopupWindow.CreateConfirm` |
| Broadcast news | MOTD banner |

**`Log.Error` is not just a log line β€” it opens a modal.** `UiLogSink` shows a
`PopupWindow` for anything at Error or above (when `ErrorPopups` is on), with
identical messages suppressed for a minute. Reserve it for "the thing you asked for
did not happen". Anything routine that fails β€” a CDN retry, a missing optional tool β€”
is `Warning` or `Debug`, or you are throwing a dialog at somebody in VR.

**Status bar** is `MainWindowViewModel.StatusText` (left) and `CacheStatusText`
(right), bound in `MainWindow.axaml`. It is for standing state β€” "server running",
cache size β€” not transient results. It survives a tab switch, so anything written
there stays until something else overwrites it.

**Tab-local status** is the `StatusMessage` / `StatusMessageColor` pair that
`ActiveConnectionsViewModel`, `SettingsViewModel` and `HistoryViewModel` each carry,
usually behind a small `SetStatus(message, colorHex)`. This is the default for
per-action feedback. Existing colours: `#81C784` success, `#FFB74D` pending or
unsaved, and red for failure.

**Dialogs** are `Views/PopupWindow`. Message only:
`await new PopupWindow(text).ShowDialog(owner)`. Confirmation:

```csharp
var dialog = PopupWindow.CreateConfirm(message, Localizer.Get("Yes"), Localizer.Get("No"));
dialog.Title = Localizer.Get("ConfirmClearCacheTitle");
await dialog.ShowDialog(owner);
if (dialog.Confirmed) { ... }
```

`SetFolderHint(label, path)` adds a clickable path, for "put the file here" errors.
There is no text-prompt dialog β€” add a field to the relevant view instead of
inventing one.

Every one of these takes a `Localizer.Get` key, never a literal. Owner windows can be
null during startup: `App.MainWindow` is null until the UI exists, and force-unwrapping
it in a log sink once took the whole application down over a log line.

## Style

Match upstream β€” this fork should read like the same project.

- File-scoped namespaces (enforced as a warning by `.editorconfig`), 4 spaces, `var`
where the type is obvious.
- Serilog structured logging with named holes and a trailing period:
`Log.Information("Added new default rule '{RuleName}'.", rule.Name)`. Never
interpolate into the template. `Log.Debug` for diagnostics, `Warning` for degraded
behaviour, `Error` only when something the user asked for did not happen.
- Comments explain *why*, especially the non-obvious constraint or the bug that made
the code look like this. Do not narrate what the line already says.
- User-facing strings are always localization keys, never literals.
- Tests are xUnit, named as a sentence describing the guarantee
(`NoticeTextNamesTheFileTheOldSettingsAreActuallyIn`), and async rather than
blocking on a task (xUnit1031).

### UX

- Never surprise the user with a privileged prompt. Elevation is opt-in per call
site: an explicit button may prompt, an automatic setting toggle may not.
- Report honestly. Degraded outcomes get their own state and their own message β€”
"needs privileges", "not supported here" and "failed" are three different things
and the UI says which.
- Destructive or outward-facing actions confirm first, and say exactly what will
happen ("Delete all {0} cached videos? This cannot be undone.").
- The app runs alongside VR. Nothing may block, freeze the window, or steal focus.
47 changes: 32 additions & 15 deletions BrowserExtension/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
# VRCVideoCacher Cookies Exporter

Sends your YouTube cookies to VRCVideoCacher (`http://localhost:9696/youtube-cookies`)
Sends your YouTube cookies to VRCVideoCacher (`http://127.0.0.1:9696/api/youtube-cookies`)
in Netscape format so yt-dlp can use them. Pushes automatically every time a
youtube.com tab finishes loading, or on demand by clicking the toolbar icon.
youtube.com tab finishes loading (when the "share automatically" toggle is on), on demand
from the toolbar popup, or when the app itself asks for a refresh.

`chrome/` and `firefox/` each hold a self-contained extension (same `background.js`,
browser-specific `manifest.json`).
## Layout

## Load unpacked (for testing)
`chrome/` and `firefox/` are each a self-contained, load-unpacked-able extension. Four
files are byte-identical between them:

**Chrome:** `chrome://extensions` β†’ Developer mode β†’ Load unpacked β†’ pick `chrome/`.
cookies.js i18n.js popup.js popup.html

**Firefox:** `about:debugging` β†’ This Firefox β†’ Load Temporary Add-on β†’ pick
`firefox/manifest.json`.
They have to physically exist in both directories, which makes it easy to fix something in
one copy and forget the other. `build.sh --check` fails if they drift, and CI runs it.

## Package for upload
Two files are deliberately per-browser:

Chrome Web Store wants a `.zip` with `manifest.json` at the root:
| File | Chrome | Firefox |
| --- | --- | --- |
| `manifest.json` | MV3 | MV2 |
| `background.js` | service worker, `importScripts("cookies.js")` | background scripts, loaded via the manifest |

```sh
cd chrome && zip -r ../chrome-extension.zip . && cd ..
```
### A note on Manifest V2

Firefox (AMO) the same:
The Firefox extension is still MV2. Firefox continues to support it, but it is on a
deprecation path, and Firefox's MV3 is not the same shape as Chrome's β€” it uses event
pages with `background.scripts`, not a service worker β€” so the two manifests will still
differ after a migration. Worth doing, but it needs testing in an actual Firefox profile.

## Build

```sh
cd firefox && zip -r ../firefox-extension.zip . && cd ..
./build.sh # verify shared files, then package both into dist/
./build.sh --check # verify only (what CI runs)
```

`dist/` is generated and gitignored. Packaged zips are not committed: the previous ones
had gone stale against the source, and were being bundled *inside* newly built packages.

## Load unpacked (for testing)

**Chrome:** [`chrome://extensions`](chrome://extensions) β†’ Developer mode β†’ Load unpacked β†’ pick `chrome/`.

**Firefox:** [`about:debugging`](about:debugging) β†’ This Firefox β†’ Load Temporary Add-on β†’ pick `firefox/manifest.json`. Temporary add-ons are removed when Firefox closes. For permanent unsigned installation in Firefox Developer Edition / Nightly, set both [`xpinstall.signatures.required`](about:config#xpinstall.signatures.required) and [`extensions.langpacks.signatures.required`](about:config#extensions.langpacks.signatures.required) to `false` in [`about:config`](about:config).
Loading