How bonaguidin/tc-analyzer works
T&C Analyzer is a Chrome extension that detects terms pages, extracts their text, asks an LLM to flag potentially harmful clauses, and presents a severity summary with detailed results. The main path runs from the page content script through the popup and analyzer to the model, then to the popup and optional detail tab. The background worker manages badges and session results. The README documents accordion expansion, search-page exclusions, truncation warnings, and the detailed clause breakdown. Edges are limited to relationships visible in the excerpts or explicitly described in the README.
Main entry points: popup.js Analysis popup · content.js Detect & extract · analyzer.js Prompt & analyzer · background.js Badge & session worker
Components 9
Page Detection
- Detect & extract
tc-analyzer/content.js
Analysis Flow
- Analysis popup
tc-analyzer/popup/popup.js - Prompt & analyzer
tc-analyzer/lib/analyzer.js
Results & State
- Badge & session worker
tc-analyzer/background.js - Session result store
- Detailed results view
tc-analyzer/results/results.js
Other components
- Extension user
- Terms page
- OpenRouter model API
Connections 13
- Terms page → Detect & extract: scans content
tc-analyzer/content.js - Detect & extract → Badge & session worker: reports detection
- Extension user → Analysis popup: opens & analyzes
- Analysis popup → Detect & extract: requests extraction
tc-analyzer/popup/popup.js - Detect & extract → Analysis popup: returns extracted text
tc-analyzer/content.js - Analysis popup → Prompt & analyzer: analyzes text
tc-analyzer/popup/popup.js - Prompt & analyzer → OpenRouter model API: sends prompt
tc-analyzer/lib/analyzer.js - OpenRouter model API → Prompt & analyzer: returns analysis
tc-analyzer/lib/analyzer.js - Analysis popup → Badge & session worker: updates badge & result
tc-analyzer/popup/popup.js - Badge & session worker → Session result store: stores result
tc-analyzer/background.js - Analysis popup → Session result store: caches result
tc-analyzer/popup/popup.js - Extension user → Detailed results view: opens full breakdown
- Detailed results view → Session result store: reads result
tc-analyzer/results/results.js