Page 1 of 5

Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Tue Jan 01, 2013 7:01 am
by SNLThe_Office
A helpful feature that AdBlock Plus could have would be the ability to enable ads before YouTube videos on certain channels. The user would be able to make a list of the channels that they are willing to see ads on, and AdBlock would block the ads on the other channels. This would be helpful for those who believe that certain channels deserve the monetary compensation they receive from AdWords and they are willing to watch ads for them while blocking the ads on the channels that the user would prefer not to see ads on.

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Wed Jan 02, 2013 5:16 am
by lewisje
ABP currently does not monitor HTTP responses, only requests, and there is nothing in an HTTP request on YouTube to determine what channel a video is associated with; you only have the URL (which has no info. whatsoever about channel), the referer (which can vary), and the type of request (which will always be "object-subrequest" in our case).

Now you can already enable YouTube ads per video, but without monitoring HTTP responses (a massive undertaking that IIRC Palant & Co. are opposed to), you can't enable ads per channel.

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Mon Mar 04, 2013 11:59 pm
by blank
The <span itemprop="author"> tag contains the channel url, so adblock could check this on any youtube video page.

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Tue Mar 05, 2013 12:22 am
by blank
Being unregistered, I can't edit posts. The following element hiding rule hides the element containing the channel URL
youtube.com##span[itemprop="author"]>link[href="CHANNELURL"]

If there were a way to exempt or block the whole page when an element hiding rule matches within the page, this is sufficient to accomplish the suggestion. This would also allow blocking ads in iframes based on an element the frame contains.

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Wed Mar 06, 2013 10:00 pm
by auserofabp
blank wrote:If there were a way to exempt or block the whole page when an element hiding rule matches within the page, this is sufficient to accomplish the suggestion. This would also allow blocking ads in iframes based on an element the frame contains.


That defeats the purpose of adblock because the page would need to load for ABP to determine whether it should be blocked. I'm pretty sure most users don't want that.

If your suggestion is limited to the top-level page, it's a bit more realistic. Still, you would probably need to select the element via Javascript, which works much differently from CSS. If ABP can be disabled by other addons, you could write one... :)

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Thu Mar 07, 2013 9:36 pm
by blank
It would only need to load the html, so the browser could load the page, then adblock plus could check if it should be disabled, and if so, disable itself, then load the other resources that adblock plus would otherwise block.

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Fri Mar 08, 2013 12:43 am
by auserofabp
blank wrote:It would only need to load the html


Right, but if we're not talking about the top-level page then that's more than enough to track users in a way that ABP currently can prevent.

blank wrote:so the browser could load the page, then adblock plus could check if it should be disabled, and if so, disable itself, then load the other resources that adblock plus would otherwise block.


I'm guessing from https://adblockplus.org/forum/viewtopic.php?f=4&t=5977 that the ABP developers don't want to implement this, which is why I suggested writing your own addon. If disabling ABP via another addon isn't possible, you could fork ABP, but there you would have to decide whether that's more of a pain than clicking "Disable on this page only" once for each video on a channel.

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Fri Mar 08, 2013 9:48 am
by blank
If by top-level page, you mean page that the user directly requested, as opposed to homepage of a site, then only the top-level page would need to be loaded to implement this (though hiding iframes, etc. would require checking those as well)

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Fri Aug 30, 2013 1:59 am
by anon0
Hi, I too would like to support some of the YT channels. Hell, there are some that are so good, I'd even watch the god-damn 30 second ads before the video that you can't skip most of, provided it'll bring a cent to the author(s).

PostPosted: Tue Sep 03, 2013 8:21 am
by schippi
with greasemonkey you can setup exactly what you want though im sure there are much more elegant solutions

greasemonkeyscript:
Code: Select all
var u = window.location.href;
if(u.search("user=") == -1){
   var cont = document.getElementById("watch7-user-header").innerHTML;
   var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,'');
   window.location = u+"&user="+user;
}


the you can whitelist the URL by adding a rule for each user:
Code: Select all
@@|http://www.youtube.com/watch*user=TotalHalibut

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Tue Sep 03, 2013 8:52 am
by schippi
sry, forgot to put in the header of the monkey script

Code: Select all
// ==UserScript==
// @name        Youtube opt in Ads per channel
// @namespace   schippi
// @include     http://www.youtube.com/watch*
// @version     1
// ==/UserScript==

var u = window.location.href;
if(u.search("user=") == -1){
   var cont = document.getElementById("watch7-user-header").innerHTML;
   var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,'');
   window.location = u+"&user="+user;
}

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Wed Sep 25, 2013 12:48 pm
by hadnafeesn
I wonder if any reader of the forum who also owns one such instrument may kindly provide a copy of it. That would be much appreciated.

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Thu Sep 26, 2013 4:51 am
by ashleyco
I too would like to support some of the YT channels.

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Thu Sep 26, 2013 8:39 am
by mapx
as I saw some comments on adblock plus twitter channel, it seems the devs are thinking to implement such a request for YT

Re: Suggestion: Enabling YouTube Ads Depending on Channel

PostPosted: Tue Oct 22, 2013 1:44 am
by Dr.Bones
Thanks a Bunch schippi!

I actually wanted to support TotalBiscuit :). Your script inserted into Tampermonkey did the trick. I just needed a while to figure out to whitelist stuff in ABP you just add a filter :oops: . The only thing i needed to change was the last line to actually change the href property of the window.location element. For some reason it would work manually but not in a tampermonkey script. The script below is the one that worked for me. All credits go to schippi

Code: Select all
// ==UserScript==
// @name        Youtube opt in Ads per channel
// @namespace   schippi
// @include     http://www.youtube.com/watch*
// @include     https://www.youtube.com/watch*
// @version     1
// ==/UserScript==

var u = window.location.href;
if(u.search("user=") == -1){
   var cont = document.getElementById("watch7-user-header").innerHTML;
   var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,'');
   window.location.href = u+"&user="+user;
}


And dont forget to add the filter to AdBlock Plus!