I just pasted a Reddit link to share with someone privately here on Mastodon, and got notified by @Tuba that it had removed a tracking parameter from the link! This kind of QoL improvement is what I think takes an app from good to great.
@bragefuglseth @Tuba As long as it never removes something it shouldn't remove because it thinks it's tracking, but in fact it is a code that gives access or an affiliate link or anything like that.
The filters are mostly from brave browser's source code and if there's something cryptobros love, is their affiliate links.
(But there's also a switch in settings to turn it off :3
FWIW, Tuba also strips tracking params from every link the user clicks. The idea and filters came from kop316@fosstodon.org who submitted them to Chatty!)
@GeopJr @forteller @bragefuglseth Nice, I was thinking about adding something similar to Moshidon a while ago, mind if I get inspired by your code?
@FineFindus Sure! Though, there are probably better/simplier ways to do it in Java
Just make sure that (stuff we noticed from the MR discussions and revisions we had):
Here's some tests: https://github.com/GeopJr/Tuba/blob/main/tests/Tracking.test.vala#L14
In the stripping code, there's the main stripping method and a fallback. The fallback was from the original Chatty MR but after the above mentioned shortcomings I suggested the GLib Uri one (but kept the fallback just in case it fails). You should follow the main one and use whatever Uri handling library is available!
@GeopJr Thanks for the info! I don't think the fallback is needed in our case, since Android's Uri class is very mature. Feel free to take a look at my approach https://github.com/LucasGGamerM/moshidon/pull/470
Also, as a fun fact, I learned through this that Android actually has a UrlQuerySanitizer, though unfortunately it does not work in this case.