How to get rid of URL parameters?

How can I get rid of URL parameters on sites with help of uBlock Origin? For example, I want to remove all parameters on aliexpress.com - ?spm= and other, they are all at least useless.

I am sadly not aware of any way to do so with any adblockers known to the human species.

I am however aware of a fairly small extension called Redirector which can be used for such things. I have a handful of entries of such URL shortening for Google and eBay in one of my importable lists for that extension.

1 Like

The point is cross-browser support. Preferably with uBlock Origin because of its brilliant conception of updated filter lists (ok, AdBlock Plus was the first, but now the best is UO).

I have an extension in desktop Mozilla too, but it is not a good solution. It is not cross browser and it cannot be constantly updated via subscriptions.

AdGuard Adblocker 3.X can do remove most tracking parametrs with Stealth Mode.

Stealth Mode

Protect your identity and sensitive personal information from thousands of online trackers by blocking the most popular tracking methods.

RTP

3 Likes

Internal strict blocking of uB0, Nano and any forks that regularly follow upstream update can use that ability to strict blocking anything once you’ve apply the $document or $important switch for any URLs and/or requests that you want to block, here’s an example of my lists that aim to block unwanted parameters.

https://github.com/kowith337/PersonalFilterListCollection/raw/master/filterlist/other/SurvivedTrackingLinkWarning.txt

Also you can see how it works in this issue that I’ve pinned about new tracking parameter named as fbclid below, I think if the sites include any Facebook widget and/or script tracking, it’s very easy for Facebook to know your behavior and more preciously to targeting ads and suggestions…

https://github.com/kowith337/PersonalFilterListCollection/issues/19

Firefox legacy extensions (Not recommend because the browser itself is out of date)

  • Clean Links (Note it may not work with e10s, such as CyberFox, Waterfox)
    • You need to repack zip and rename file extension to xti, also turn the xpinstall.signatures.required value to false

Chrome extensions (and/or Firefox WebExtensions)

  • Avoision
    • This not just strip parameters, it’s also redirect some news site article to archive services to avoid getting you counted as a part of their site traffic
    • Repo owner refused to upload into any add-ons catalog sites, you may need find a way to sideload this

User scripts

1 Like

Very interesting way. But
||aliexpess.com/*?spm=$document,important
filter doesn’t work. Maybe I didn’t properly catch the idea?

Try change to & instead of ? after wildcard to catch another parameter, because the first parameter will begin with ? while the rest are use & and later on…

||aliexpess.com/*&spm=$document,important

1 Like

Doesn’t work too :frowning:

You must copy link after blocked by uBO, to remove parameter manually.


also remove similar:

no-strict-blocking: aliexpress.com true
no-strict-blocking: * true

from “My rules” tab.

I think I need to learn RegEx more and more…

Requirement: https://github.com/uBlock-user/uBO-Scriptlets

Example line: https://github.com/uBlock-user/uBO-Scriptlets/blob/010afd38c0a0c26a50b5ffe748d35d60ef792b1a/scriptlets.txt#L643

aliexpress.com##+js(query-stripper.js, /(\?|\&)spm=.+/)

1 Like

W/O RegEx –

(function() {
		let query = '{{1}}';
		if (location.href.indexOf(query + '=') !== -1) {
			let url = new URL(location);
			url.searchParams.delete(query);
			window.location.href = url;
		}
})();

Interesting, but query-stripper.js is not in the standard library set, which can be invoked directly from a subscription filter list.

It’s my own. I maintain it. You can add it via Advanced Settings in uBO, if you want to.

1 Like

Also offtopic FYI, standard library set is now dead effective immediately with https://github.com/gorhill/uBlock/commit/6f5aa947fb3b2abdd112411f34995233b28f7bf9#commitcomment-34206609.