Add site definition worker inference

This commit is contained in:
Jordan Wages 2026-08-25 17:05:11 -05:00
commit 3ccdaaf953
17 changed files with 250 additions and 50 deletions

View file

@ -5,6 +5,7 @@ VibeGuard is a local-first browser extension that hides toxic social-media posts
## Features
- Local toxicity classification using Transformers.js and a quantized ONNX model.
- Local CPU/WASM inference with ONNX Runtime.
- Configurable toxicity threshold and filtering mode: collapse posts with a Show button or hide them completely.
- Optional toxicity scores on filtered-post placeholders.
- Declarative site definitions with URL patterns, selectors, and stable identifiers.
@ -66,6 +67,8 @@ Supported page
The model is loaded once by the shared inference backend for each browser context. Content scripts send normalized text to the background runtime and apply the returned score to the matching DOM element. Results are cached in memory to avoid repeating work when dynamic sites recreate elements.
Inference runs locally through ONNX Runtime's WASM backend using the bundled quantized model.
## Options page
Open the extensions options page to change the threshold, filtering mode, and score display. The Site definitions section manages JSON subscriptions, which refresh automatically once per week and can also be refreshed manually. Local overrides can be imported from or exported to JSON and are validated before they are saved. A failed or invalid subscription update leaves the last-known-good definitions active.