How kartikvermagit-ds/nudgekavach works
NudgeKavach is a local-first Chrome extension for observing possible dark patterns and presenting NudgeProof evidence, alongside a controlled demo store and comparison mode. The main workflow is: a user opens a page and starts or receives monitoring; the content script observes page changes, applies deterministic rules, retains findings and timeline events in tab memory, and presents an on-page panel with highlights and JSON export. The local server only hosts the demo frontend. The README documents the five detector types and other panel capabilities; omitted source excerpts limit certainty about some internal UI wiring.
Main entry points: content.js Page observer · server.cjs Demo HTTP server · popup.js Scan activation · store.js Store and comparison
Components 14
Demo frontend
- Store and comparison
frontend/store.js - Store page
frontend/index.html - Presenter guide
frontend/guide.html
Local hosting
- Demo HTTP server
backend/server.cjs
Browser extension
- Toolbar popup
extension/popup.html - Scan activation
extension/popup.js - Page observer
extension/content.js - Deterministic detectors
extension/rules.js
Evidence experience
- Findings and timeline
extension/content.js - Evidence panel
extension/content.js - NudgeProof JSON
extension/content.js
Other components
- User
- Chrome browser
- Open page
Connections 17
- User → Chrome browser: opens page
- Chrome browser → Demo HTTP server: requests demo
- Demo HTTP server → Store page: serves frontend
- Demo HTTP server → Presenter guide: serves frontend
- Store page → Store and comparison: loads script
- Store and comparison → Open page: updates demo DOM
- User → Toolbar popup: starts scan
- Toolbar popup → Scan activation: invokes scan
- Scan activation → Chrome browser: queries active tab
- Scan activation → Page observer: injects scripts
- Page observer → Open page: observes DOM
- Page observer → Deterministic detectors: evaluates observations
- Page observer → Findings and timeline: records evidence
- Findings and timeline → Evidence panel: renders findings
- User → Evidence panel: controls monitoring
- Evidence panel → NudgeProof JSON: exports report
- User → NudgeProof JSON: downloads report