Skip to content

Psychosynthesis/Eraser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracking URL Params Remover

Dynamic JSON Badge     Dynamic JSON Badge     Donation page

About

This is browser extension for removing a lot of tracking query params (itm_*, utm_*, fbcli, gclid, ysclid, ...and so on.) from URLs before they load. The editable default list of blocked parameters is stored in the shared constants file:

Users can edit this full list in the popup or save a separate full list for the current domain.

Architecture notes

Browser packages are kept in separate src/chrome and src/firefox directories, while shared defaults and settings normalization live in src/shared/constants.js and src/shared/settings.js. Browser-specific common/utils.js files are limited to storage/API glue; filtering and settings logic stays in common/settings.js after the shared files are copied during build. Chrome uses Manifest V3 with dynamic declarativeNetRequest rules, while Firefox uses Manifest V2 with webRequestBlocking.


Debugging

For debugging, you need to install extensions directly from the file.

To do this, type in the address bar: about:debugging#/runtime/this-firefox

Sometimes it is necessary to install an unsigned update from a compiled file. For this go to about:config тype in search xpinstall.signatures.required and set to false.

In the current session, you will be able to install unsigned extensions until you restart firefox.

For build extensions run bash build.sh from the main directory of this repository. Or just manually copy shared libs in a both browser dirs and pack the files in the directory corresponding to the browser into a zip archive (for Firefox you need to change its extension to .xpi).

Shared constants, settings helpers, and common popup styles live in src/shared/constants.js, src/shared/settings.js, and src/shared/panelMenu.css. During bash build.sh, they are copied into each browser package as common/constants.js, common/settings.js, and panel/sharedPanel.css before zipping and removed again after the archives are created, so generated browser-local copies should not be committed. For unpacked debugging from src/chrome or src/firefox, run bash build.sh --keep-shared first to leave those temporary copies in place.


Firefox installation

Available on addons.mozilla.org: https://addons.mozilla.org/ru/firefox/addon/utm-eraser


Chrome / Chromium installation

Available on Chrome Store: https://chromewebstore.google.com/detail/utm-eraser/cepijkcnhhbjgiofhdhbomcgdmfjbbhb

For debug extension on Chrome do next steps:

  1. Run bash build.sh --keep-shared from the repository root
  2. Menu -> "More Tools" -> Extensions menu
  3. Toggle Developer mode on
  4. Click "Load unpacked"
  5. Click and "Open" on the folder src/chrome

This should stay installed even when exiting/restarting.
Might get a notification pop up warning you about dev-mode though.


Differences between versions

Please note that Firefox and Chrome versions use different approaches.

Using "webRequestBlocking" is not compatible with the v.3 manifest because the geniuses from Chrome team decided to charge money for this functionality — it's only available for "enterprise" add-ons (because it allowed to effectively block ads and, of course, that was unacceptable!). Therefore, the Chrome version uses dynamic declarativeNetRequest rules generated from the user's editable parameter list. Firefox still uses webRequestBlocking, so both versions can apply the selected full list before the page load, but through different APIs.

Old versions of Firefox (for old OS) doesn't allow you to work properly with the third version of the manifest, although it can still be done: the developer preview of Manifest V3 is available since Firefox 101. To test your extensions you need to turn on the MV3 features. To do this, go to about:config and:
Set extensions.manifestV3.enabled to true.
Set xpinstall.signatures.required to false.

TODO

  • Check Firefox Mobile Extensions API for compatibility

About

Web-extension for removing tracking query parameters in a link (utm, fbclid, etc.)

Topics

Resources

License

Stars

Watchers

Forks

Contributors