Doing a good job of that is complicated, maybe too much so for ublock origin. Besides stripping off junk parameters, you have to bypass redirects, unquote parameters and recursively clean up anything that looks like a url, and do a bunch of site specific rewriting. Here’s the regex I use just for crap parameters:
ref_src and ref_url are used by twitter. Actually (at end) we
kill anything that ends with ‘id’ since that yet caused any probs.
Doing a good job of that is complicated, maybe too much so for ublock origin. Besides stripping off junk parameters, you have to bypass redirects, unquote parameters and recursively clean up anything that looks like a url, and do a bunch of site specific rewriting. Here’s the regex I use just for crap parameters:
ref_src and ref_url are used by twitter. Actually (at end) we
kill anything that ends with ‘id’ since that yet caused any probs.
junk_regexp = r’gclid$|gclsrc$|fbclid$|aff$|msclkid$|[uhi]tm_.|hmb_.’ +
‘|ref_src$|ref_url$|pr_.|spm(_.)?|(pos|sid|ss)$|cvid$’ +
'|kx$|variant$|mc.id$|ad_id$|cm_mmc$|sara_ecid$|guce.*’ +
‘|.campaign(id)?$|adsetid$|_cf_chl_f_tk$|cm_sp$’ +
'|…*id$|trk.|gs_lcrp$’ if base.endswith(‘.php’): junk_regexp += ‘|s$’