RepoPilot

gorhill / ublock

Search gorhill/ublock

GitHub

Code

How gorhill/ublock is laid out, and where to start for common changes.

There is no import map for this report yet.

Where to start reading

  1. Repository root
  2. Repository root
  3. Suggested starting pointAI
  4. Suggested starting pointAI
  5. Suggested starting pointAI
  6. Suggested starting pointAI
  7. Suggested starting pointAI
  8. Suggested starting pointAI

Find files for a task

AI

Add a New Filter List Source

  • Register the new third-party filter list URL in the default asset registry or allow user to add via dashboard.
  • Implement fetch, parse, and compilation logic for the list format (likely line-based or browser extension filter syntax).
  • Add UI row to enable/disable and update the filter list in the dashboard.
  • Handle cache invalidation and update state propagation.

Add a Custom User Filter Rule

  • User edits custom filters in the editor UI and saves.
  • Persist the rule set and recompile the filtering trie.
  • Clear cache and notify all contexts (pages, popup, dashboard) of the new rules.
  • Apply the new rule to pending and future requests in the filtering engine.

Add a New Dashboard Page or Settings Tab

  • Create a new .html page with matching CSS in src/css/ and JS logic file.
  • Register route/tab in the dashboard main controller to navigate to the new page.
  • Use broadcast.js to communicate settings changes to the background service worker.
  • Add localization strings for all languages under src/_locales/{locale}/messages.json.

Implement a New Content Script Behavior (e.g., fingerprint defense)

  • Write the defense logic as a standalone IIFE module in src/web_accessible_resources/.
  • Register injection conditions and timing in the background service worker.
  • Test via devtools panel or logging to verify behavior on target pages.

Add or update tests

Change build or automation

RepoPilot lists up to 500 files, so a file missing here may still exist.

  • No public API or start-up file could be picked out from the file names.

Code quality and hotspots

Largest source files

  • Branch points726 per file on average
  • Code issues7 errors, 2164 warnings
  • Largest file9,801 lines
  • Hotspot load3 high-risk files

Static checks on the 15 largest source files.

Tests, CI and tooling

  • CIGitHub Actions1 workflow
  • Tests17 test files0.06 test files per source file (file count, not coverage)
  • Dependency updatesNo config detected

Test folders: docs/tests · platform/npm/tests · platform/npm/tests/data

Hotspots

Files that change often and branch heavily, highest first. Branch points count if, loop, case, catch, ternary, && and || in the file.