Skip to content

Loading…

How do I "whitelist" a youtube channel? #405

Closed
sooqua opened this Issue · 15 comments

4 participants

@sooqua

I'm trying to get this script to work: https://greasyfork.org/en/scripts/4168-youtube-whitelist-channels-in-adblock-plus
But I'm stuck with this fr*cking filter that just won't work no matter what I do.

@sooqua

why is this not working?
@@||youtube.com^$document

@gorhill

$document is not supported in filters. To support what you wish here, the clean solution is to extend the syntax for whitelisting.

I don't like ABP's $document option, it is hacky, because it's a filter which is quite different from other filters: all other filters apply to each net request themselves. The $document option influence the outcome of future net requests, so really it should be part of the whitelist directives, not part of the filter set.

@gorhill

I will extend the whitelisting syntax such that to whitelist for the example you link to will be to use this line as a whitelist directive:

https://youtube.com/*&user=[PASTE THE USER NAME HERE]*
@gorhill gorhill added a commit that referenced this issue
@gorhill gorhill this addresses #405 a85f64c
@kurtextrem

Nice! Great news.

@kurtextrem

You should add this to the wiki I'd say.

@gorhill

The feature is not released yet. I want to add more code to harden, and make the feature more friendly internally. For example, imagine adding a complicated whitelist directive -- like the one for Youtube above -- which could be removed by the a simple click on the big power button. I have in mind that when this happens, the directive will be commented out rather than being removed for directives which cannot be easily recreated from the popup UI.

@sooqua

Would it ever be possible to whitelist a youtube channel without external script, so it won't reload each page? Besides, it's the only reason I have tampermonkey installed.

@kurtextrem

It is possible without tampermonkey, I could do an extension. But I don't think it will be possible without a reload: First of all the page needs to be downloaded, to add the youtube username to the url. After that the reload is a must. uBlock checks the url, finds out it is on the whitelist and doesn't block ads. A whitelist-without-reload would only work if Youtube sent the username in the header, or in the ads' urls. (They didn't last time I've checked)

@sooqua

Actually I was thinking of parsing HTML text directly through uBlock

@kurtextrem

Oh yes, that'd be cool.

@sooqua

It's just the only solution I can come up with right now... :\

@gorhill

parsing HTML text directly through uBlock

There is no guarantee this won't require reload: there is no guarantee secondary resources are not trying to load before the HTML can be parsed. There is also that this is a rather ugly hack for a very specific case (Youtube). The real fix should be on Youtube's side -- to provide info in the URL about who uploaded a specific video.

@kurtextrem

A tiny improvement could be this:

  • You open a youtube link
  • You watch the video until it's over
  • The script adds the username to the url, reloads the page, mutes the commercial and closes the tab after it's over

not the best.. but would be better than opening a link, letting it reload, watching the ad, watching the vid

@bestpika

Could I write @@||youtube.com^ ?

@gorhill

Could I write @@||youtube.com^?

This would whitelist requests from youtube.com regardless of channel, not the same thing as whitelisting a specific youtube.com channel.

@gorhill gorhill closed this in d5a3226
@gorhill gorhill added a commit that referenced this issue
@gorhill gorhill code review for #405 b12bc6a
@gorhill gorhill added a commit that referenced this issue
@gorhill gorhill # is allowed with fix to #405 084a1ef
@gorhill gorhill added a commit that referenced this issue
@gorhill gorhill more changes related to fix to #405 49d77ea
@gorhill gorhill added a commit that referenced this issue
@gorhill gorhill code review related to #405 a1172b1
@jmranger jmranger referenced this issue in gorhill/uBlock
Closed

Dead link in wiki #259

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.