Hacker News new | ask | show | jobs
by jegutman 3598 days ago
I thought most ad blocking right now depends on the fact that ads are served from different locations than the sites themselves. You can try to block native ads being served by the same stuff that serves the page, but it's reasonably more difficult and prone to false positives.

There's a separate issue that as they try harder to block ads they will also make it less clear what's an ad. For example many ad blockers don't work on google search results because they're fed back with the result content, but it also becomes less and less obvious what's an ad and what's a search result on google.

1 comments

Compared to Amazon search ads, Googles are trivial to block. But I think that in both cases as well as with Facebook newsfeed ads, cosmetic filters are the way to go anyway.

Those add css properties to page elements that make the element disappear. Here is an example for advanced cosmetic filter options: https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#...

edit: nvm my amazon comment. I spent the last hour vaguely understanding xpath to create a filter for (German) Amazon sponsored search results.

    amazon.de##:xpath(//*[@id="s-results-list-atf"]/li/div[1]/div[1]/div[1]/div[2]/h5[text()="Gesponsert"]/../../../../..)