trackerdb icon indicating copy to clipboard operation
trackerdb copied to clipboard

TrackerDB development setup

Open chrmod opened this issue 1 year ago • 1 comments

Lets create a tool for testing changes in TrackerDB.

I imagine a node app started with npm start that do couple things:

  • watches for changes in db and compiles new adblocker engine on every change
  • start http server to host the constructed adblocker engine
  • runs web-ext to load testing extension in Firefox

The testing extension is a tool similar to uBO logger. It opens an extension page that:

  • loads tracker db adblocker engine from the http server started by a node process
  • has a button to fetch new version of the engine
  • listen to webRequest events and use tracker db to match all requests
  • for every request it adds to DOM a new element with details of the url and result of matching

In the future we can add more features like:

  • filtering logs by tab id
  • loading production version of tracker db adblocker engine (from adblocker-filters)
  • pause/resume/clear the logging

chrmod avatar Dec 19 '23 17:12 chrmod

Initial schema for TrackerDB development setup

New TrackerDB development toolkit is basically consisted of two components:

  • server
  • extension

In each component, the purpose and goals are different.

Server

Server component helps tracking local files. The management of local files, especially folders are not easy with web extension. So, the main purpose of server is to merge specified local TrackerDB and filter lists. In the first sprint, a way to specify source was using URL schema.

  • Tracking local files and folders.
  • Automatically extracting filters from TrackerDB. (depends on TrackerDB specs)
  • Export engine bytes of @ghostery/adblocker and filters in text format.

Server component is written using Fastify with TypeBox and can have complex features in future.

Extension

Extension component is a simple ad-blocker that does work similar to Ghostery Browser Extension. Matching the behavior is important but there will be differences in current timespan.

  • Network filtering and cosmetic filtering support.
  • TrackerDB rules won't be treated special, so exclusion rules can work properly. (will follow GBE changes)
  • Loading filter lists online but also engine bytes from @ghostery/adblocker.
  • Logger in uBO like interface to view what properties are blocked and what rules are used.
  • Detecting what TrackerDB entries are invovled. (Typical detection)

Some features are not targeted in very early stage.

  • Scriptlets support
  • Loading Ghostery Browser Extension preset (will change in next timespan)

Extension component will be written using web-ext for Firefox support. However, this can be changed in future so we can support other browsers too. At the specific point, implementing the feature of logger interface in Ghostery Browser Extension can be better.

seia-soto avatar Dec 21 '23 01:12 seia-soto