adblock-rust icon indicating copy to clipboard operation
adblock-rust copied to clipboard

Support uBO/Adguard removeparam filter

Open ryanbr opened this issue 3 years ago • 1 comments

Supporting removeparam, will give us the ability to filter out tracking bits of a url.

https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#removeparam https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters?aid=16593#removeparam-modifier

To test in uBO. add ||google.com^$removeparam=/(num|oq|gs_l)/ or ||google.*^$removeparam=/(num|oq|gs_l)/

Test the following url: https://www.google.com/search?num=100&q=google&oq=google&gs_l=serp.3..0l10.7976.8565.0.9999.6.6.0.0.0.0.358.617.2-1j1.2.0....0...1c.1.64.serp..4.2.615.BQ3ZvdzuPGE

(In order of codes, expanded also works)

$removeparam=num,domain=google.com
$removeparam=oq,domain=google.com
$removeparam=gs_l,domain=google.com

The above google.com url simply becomes https://www.google.com/search?q=google

Another sample (with wildcards)

https://www.bbc.com/news/world-africa-56637573?xtor=AL-72-%5Bpartner%5D-%5Bbbc.news.twitter%5D-%5Bheadline%5D-%5Bnews%5D-%5Bbizdev%5D-%5Bisapi%5D&at_medium=custom7&at_custom2=twitter&at_campaign=64&at_custom3=%40BBCWorld&at_custom1=%5Bpost+type%5D&at_custom4=B2BFEAF6-9605-11EB-97D3-02D74744363C

Can be filtered down too: ||bbc.com^$queryprune=/(xtor.*|at_.*)/ => https://www.bbc.com/news/world-africa-56637573

A few more filters tested https://0bin.net/paste/vleyxFEC#xMx8TzvreSdTwxUcbVOCFYesnjjXk4wcKCaD-U3bgMR (on various news sites). Only one bug was attempting to filter news.google.com links would cause redirection issues.

ryanbr avatar Apr 05 '21 11:04 ryanbr

Any update on this?

SwiftyPop avatar Jan 03 '22 14:01 SwiftyPop