About This Script
This script is designed to automatically detect and remove common affiliate and tracking parameters from your browsing session, leading to cleaner URLs and enhanced privacy. It operates silently in the background on all websites to ensure that tracking codes are stripped away before they can be used.
Key Features
URL Cleaning: Automatically removes any URL parameters that start with aff/ref (e.g., affid=, aff=, ref=, referral=) and have a purely numerical value. This works on:
The current page's URL in your address bar (without causing a page reload).
All links (a tags) on a webpage, preventing you from clicking on tracked links in the first place.
Dynamic Content Support: Modern websites frequently load new content without a full page refresh. The script uses a MutationObserver to watch for new links being added to a page and cleans them instantly.
Cookie Removal: Actively finds and deletes cookies whose names begin with aff, helping to prevent tracking across different sessions.
Outgoing Data Protection: Intercepts outgoing POST requests (both fetch and XMLHttpRequest) to scan and remove matching affiliate parameters from the data being sent to servers. This is crucial for forms and API calls that might include tracking information.
How It Works
The script runs at the very start of page loading (@run-at document-start) to maximize its effectiveness. It identifies tracking parameters based on two simple but effective rules:
The parameter name must begin with "aff" (case-insensitive).
The parameter's value must consist only of integers (e.g., 12345).
By wrapping the browser's native fetch and send functions, it acts as a gatekeeper for data you send, ensuring your actions are not unnecessarily tracked by these specific affiliate codes. The result is a cleaner, more private browsing experience with URLs that are shorter and easier to share.