I started looking into how to develop a “link cleaning” feature and it’s a lot more complicated than I originally anticipated.
Firefox has two different lists, one licensed under the LGPL and the other under the MPL2 but they have variations so we’d need to load both.
Brave uses a single file, licensed under MPL2, which is fine for us, that uses a regex syntax. Their algorithm appears to check the url against all patterns, skipping ones that make the exclude pattern, and then remove the specified params.
We will probably use the brave file as the source as it’s just easier to work with it.
Overall, right now I’m leaning towards a separate library for this and only this as url cleanup is something useful to a lot of applications, so having all of the other stuff from birb from example would be a bit much. Also this needs to load a bunch of data at startup and have a way to tear it down at shutdown and birb doesn’t have that right now.
I’m thinking we’ll just commit the file directly to the repo, maintaining the license as it will be unedited, then adding it to a resource that will be loaded at startup via an init method and freed via a uninit method. This would require json-glib and glib but that should be all that is necessary.
Later on, we can add support for removing tracking parameters. Brave has some good documentation on that as well.