Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Youtube ads - Additional blocking rules #3

Closed
lukemulks opened this issue Feb 18, 2017 · 1 comment
Closed

Youtube ads - Additional blocking rules #3

lukemulks opened this issue Feb 18, 2017 · 1 comment
Assignees
Labels

Comments

@lukemulks
Copy link
Collaborator

Follow up from: brave/browser-laptop#7230

I've run comparison checks against uBlock Origin, AdBlock Plus (with Acceptable Ads disabled), and Brave Shields. The data from the comparison checks is included in the following xlsx:
Youtube-blocking-comparison-02172017.xlsx

I ran some additional testing to see if I could apply any new rules in about:adblock , and with the following rules applied I am able to visibly see the video ads blocked for the first 7-10 segments I click on (the "Visit Advertiser's Site" overlay briefly shows up and then goes away quickly):

@@||google.com/jsapi$script,third-party
@@||youtube.com/api/stats/watchtime?$image,domain=youtube.com
||doubleclick.net^
=adunit&
||youtube.com/api/stats/ads?
||youtube.com/ptracking?
/generate_204$image
ad_html5&

The two exceptions applied above were observed in ABP and uBlock, which are likely in place to maintain compatibility with the video player.

However, after about 10-12 playback attempts, I'm seeing an ad appear. This is really strange. The blocking taking place initially matches what is working for users that aren't signed in.

Note: Ads are only observed while authenticated. Users that aren't signed are seeing ad blocking work as expected.

There are the following ELEMHIDE rules applied in both uBlock and ABP that I don't believe we are using:

##.ytp-ad-progress-list
##.video-ads 
youtube.com##.ad-container
###watch7-sidebar-ads
youtube.com###watch-channel-brand-div

I also attempted the isThirdPartyHost test we discussed (referenced in Slack), but I am not 100% confident I am testing that correctly.

Based on the calls that aren't blocked, I can't tell if we're just not blocking 1st party verbatim EasyList rules, or if I was testing isThirdPartyHost incorrectly, as I believe we should be seeing youtube.com requests that contain =adunit& blocked that I'm not seeing blocked in Brave (I am seeing them blocked in ABP & uBlock).

  • I know there's some objection to css blocking, so it might be worth testing the third party host settings in case I was not testing that correctly.

  • If that doesn't work, then css ELEMHIDE blocking for YT would likely be the next option.

  • If neither of those work, I think there could be a larger problem.

  • I noticed that uBlock is using EasyPrivacy, and that a lot of blocking was taking place from that list. If we're not using that, it might be worth exploring.

Thanks for the help here. This one has been a real pain.

@lukemulks
Copy link
Collaborator Author

@bbondy I made another sweep here just to make sure that things hadn't changed too much.

These are the following CSS selector/element hiding rules that ABP is using for Youtube that we currently don't block;

##.ad-div
##.masthead-ad-control
##.video-ads
###ad_creative_3
###footer-ads
###watch7-sidebar-ads
##.ytp-ad-progress-list
youtube.com##.ad-container
youtube.com###video-masthead
youtube.com###watch-channel-brand-div

These are the YT 1p calls, and filters that would work for blocking them:

=adunit&$xmlhttprequest,image

/gen_204

  • youtube-nocookie.com/gen_204

/player_204

  • youtube.com/player_204

/csi_204

  • youtube.com/csi_204

These are additional filters that blocked in ABP, we're using these already as far as I can tell, but am noting:

||doubleclick.net^$third-party,domain=youtube-nocookie.com|youtube.com
/securepubads.$script
/api/ads/*$script
||google.com/pagead/$image
/pagead2.$image,script
/pubads.$xmlhttprequest,subdocument
/googleads.$xmlhttprequest,image
/generate_204

I think that if we opened up to allow for 1p blocking, even if only for youtube.com - the issue at hand might remedy itself. That would probably be the best route we could take first.
If I can block strings from 1st parties, then we might also be able to block a lot of what ABP hits with their CSS selector rules without having to resort to CSS blocking.

  • I took a look in Opera today, with ad blocking on, and they're blocking the vast majority of ads. However, they are probably letting 1/9 ads in from what I observed.

  • ABP and AB are consistently blocking, uBO is as well, so I started with what rules they're using above.

  • If you're able to just remove the 1p blocking restriction for YT.com (or for the browser - even if it's just for a test build or something along those lines) - I can handle the rest of the testing and see what has to get resolved. I'm just stuck at that part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants