Suggestion: Enabling YouTube Ads Depending on Channel

Various discussions related to Adblock Plus development

Suggestion: Enabling YouTube Ads Depending on Channel

Postby SNLThe_Office » Tue Jan 01, 2013 7:01 am

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.
SNLThe_Office
 
Posts: 2
Joined: Tue Jan 01, 2013 6:55 am

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby lewisje » Wed Jan 02, 2013 5:16 am

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.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
lewisje
 
Posts: 2729
Joined: Mon Jun 14, 2010 12:07 pm

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby blank » Mon Mar 04, 2013 11:59 pm

The <span itemprop="author"> tag contains the channel url, so adblock could check this on any youtube video page.
blank
 

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby blank » Tue Mar 05, 2013 12:22 am

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.
blank
 

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby auserofabp » Wed Mar 06, 2013 10:00 pm

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... :)
auserofabp
 

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby blank » Thu Mar 07, 2013 9:36 pm

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.
blank
 

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby auserofabp » Fri Mar 08, 2013 12:43 am

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.
auserofabp
 

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby blank » Fri Mar 08, 2013 9:48 am

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)
blank
 

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby anon0 » Fri Aug 30, 2013 1:59 am

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).
anon0
 

Postby schippi » Tue Sep 03, 2013 8:21 am

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
schippi
 

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby schippi » Tue Sep 03, 2013 8:52 am

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;
}
schippi
 

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby hadnafeesn » Wed Sep 25, 2013 12:48 pm

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.
hadnafeesn
 
Posts: 1
Joined: Wed Sep 25, 2013 12:44 pm

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby ashleyco » Thu Sep 26, 2013 4:51 am

I too would like to support some of the YT channels.
ashleyco
 
Posts: 1
Joined: Thu Sep 26, 2013 4:48 am
Location: USA

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby mapx » Thu Sep 26, 2013 8:39 am

as I saw some comments on adblock plus twitter channel, it seems the devs are thinking to implement such a request for YT
User avatar
mapx
 
Posts: 20944
Joined: Thu Jan 06, 2011 3:01 pm

Re: Suggestion: Enabling YouTube Ads Depending on Channel

Postby Dr.Bones » Tue Oct 22, 2013 1:44 am

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!
Dr.Bones
 

Next

Return to Adblock Plus development

Who is online

Users browsing this forum: No registered users and 7 guests