idlewan / link_cleaner

Browser Webextension to clean urls from utm_* and amazon/aliexpress product pages from useless tracking parameters
99 stars 18 forks source link

Generalise parameter remover #12

Open ghost opened 7 years ago

ghost commented 7 years ago

Now we have a query parameter remover factory that takes a callback that's called on each query parameter.

idlewan commented 7 years ago

I was wondering about doing it this way for the first version. I decided to not have the indirection (even if some code was very similar), but maybe now that the list of sites is growing, it might be more justified.

I don't see a reason to remove the remove_searchparams function though, since it would be faster than going through every single search param.

ghost commented 7 years ago

I don't think there's any downside to generalising from the beginning, if it saves us from having to change everything in the future. That's a fair reason not to alter remove_searchparams; it's up to you, then.