dhowe / AdNauseam

AdNauseam: Fight back against advertising surveillance
GNU General Public License v3.0
4.55k stars 190 forks source link

Forbes Ad blocked but not collected #1087

Closed greysonevins closed 5 years ago

greysonevins commented 7 years ago

Describe the issue

Looks like it has a cosmetic filter but is not collected like the Fortune ads we fixed too. https://www.forbes.com/sites/realspin/2017/06/22/heres-what-a-worker-first-policy-might-look-like-for-the-trump-admin-think-apprenticeships/#2149fd2f85a8

image

greysonevins commented 7 years ago

@dhowe I found that easylist is blocking the revcontent ad I noted above but when I allow the js to run it doesn't seem to appear. Is there something I need to do here?

dhowe commented 7 years ago

figure out what is blocking the ad (using the ublock logger), and then add an exception rule to make it show up

greysonevins commented 7 years ago

@dhowe so I found what was blocking it and was able to find a way to grab the ads too, but the issue I am seeing now is that the ad is loaded dynamically with an <a> tag so the ad parser is not grabbing the image or href. Any thoughts here?

I used:

@@||revcontent.com^$third-party

@@||criteo.net^$third-party

forbes.com#@#.rc-item-wrapper
forbes.com#@##rc-row-container
forbes.com#@#.rc-cta[data-target]

!trying to collect the ads with this!
##.rc-item > .rc-item-wrapper > .rc-cta
dhowe commented 7 years ago

when the dom changes, the content-script should re-run... is this happening? is the ad then getting rejected as a duplicate? check the logs...

greysonevins commented 7 years ago
screen shot 2017-07-18 at 7 10 30 pm

@dhowe you'll see that the ad's photo/link/and title are all mashed into an a tag and dynamically generated by javascript. I don't think there is anything I can do with it like I had hoped.

dhowe commented 7 years ago

@cqx931 pls take a look

cqx931 commented 7 years ago

The a tag is only the link. The image is inside <div class="rc-photo-container"></div> while the ad content is inside <div class="rc-content"></div>.

We can't parse the ad with the current parser due to two reasons:

  1. The image is displayed through background image css image

  2. The a tag doesn't wrap around the ad, the link is placed over the ad through css. The structure of the ad:

    <div class="rc-item-wrapper">
    <a></a>
    <div class="rc-photo-container"></div>
    <div class="rc-content"></div>
    </div>
dhowe commented 7 years ago

Any proposed solution?

cqx931 commented 7 years ago

If we do want to parse ad like this, we need to first solve the case when image ad is displayed through css "background-image". Please see: https://github.com/dhowe/AdNauseam/issues/451

However, I'm not sure how to solve the second issue. Right now we are checking clickableParent for the image to decide whether it is an ad or not. We can also check other children div within the same parent, but we don't know whether the a tag is a link that is not related to the image, or it is placed above the img later through css. It makes more sense to me if we ignore this case rather than filter the ad out.

dhowe commented 7 years ago

I think you are right about the 2nd case, but lets start by adding a test page for the first (image ad displayed through css "background-image")...

cqx931 commented 6 years ago

background case solved in https://github.com/dhowe/AdNauseam/commit/be57516cdbefb84026df4b544c8e863e2d9c9247

Can this be closed? @dhowe

dhowe commented 6 years ago

yes, assuming we have a test case in our release tests ?