stroobants-dev / ublock-origin-shitty-copies-filter

Filter for DuckDuckGo and Google to remove those spam-websites that just blatantly copy and paste content from well known websites.
Mozilla Public License 2.0
108 stars 6 forks source link

Thanks & question about occasional leakers #3

Open OldGuyInTheClub opened 1 year ago

OldGuyInTheClub commented 1 year ago

Found you via HN and wanted to drop a note of thanks. This list is making my search life much more productive and less aggravating.

A question: I have used your examples to set up some of my own filters. For example, I don't want Amazon search results so I've added the following to My Filters and updated uBlock Origin.

duckduckgo.##.results > div:has(a[href="amazon."]) google.##.g:has(a[href="amazon."])

However, Amazon results still sneak through. I have tried to understand uBlock Origin's filtering syntax but still don't grok how to figure out or debug for myself. I've tried various wildcards with no luck. I think that maybe DDG and Google wrap Amazon results in some more complex packaging.

e.g. On one DDG leaker I see this nested deep in a div structure

<a href="/?q=cupcake%20tins+site:www.amazon.com&amp;t=ffab" rel="noopener" title="Search domain amazon.com" data-testid="result-extras-site-search-link" data-handled-by-react="true"><img src="/assets/icons/favicons/amazon.2x.png" loading="lazy" width="16" height="16"></a> It still seems like the filter should work on this since it is part of an href.

Any suggestions for this or better yet, where to learn the ins and outs of the filter syntax? I've looked at Gorhill's and the AdBlock Plus tutorials but need to learn more about the structure of webpages before I can understand what they're telling me.

realAzazello commented 4 months ago

If we understand correctly, TL;DR you want to block/hide ALL amazon URLs no matter which TLD is used...

I don't know how to do this in uBlock; but in uBlacklist this supposedly work {have not tried it myself}:

https://github.com/iorate/ublacklist/issues/306#issuecomment-1358684931

/^https?:\/\/www\.amazon\./