Greasy Fork is available in English.

YouTube uBlock Whitelister (Improved)

An improved version of Zalastax's fixed version of gorhill's tool to whitelist ads for certain YouTubers

< Feedback on YouTube uBlock Whitelister (Improved)

Review: OK - script works, but has bugs

x0a
§
Posted: 12. 04. 2017

Doesn't work, small error.

Change line 36 from
var channelId = fetchChannel();
to
var channel = fetchChannel();

§
Posted: 12. 04. 2017
Edited: 12. 04. 2017

It's line 38 not 36.

36var exposeUserInURL = function() {
37 var channel = fetchChannel();

38 var newArg = channelId !== '' ? 'user=' + encodeURIComponent(channel) : '';

working code:
38 var newArg = channel !== '' ? 'user=' + encodeURIComponent(channel) : '';

x0a
§
Posted: 15. 04. 2017
Edited: 15. 04. 2017

yes, you're right. also replace fetchChannel with

var fetchChannel = function() {
    var link = document.querySelector('[id="watch7-user-header"] a[href^="/user/"]');
    if (!link) {
        link = document.querySelector('[id="watch7-user-header"] a[href^="/channel/"]');
        if (!link) 
            return '';

    }
    var linkHref = link.getAttribute('href');
    var linkmatch = linkHref.match(/\/(user|channel)\/(.+)/);

    if (linkmatch && linkmatch[2])
        return linkmatch[2];
    else
        return '';
};

because otherwise you get "undefined" on non-video youtube pages instead of an empty string, which leads to constant reloading on playlist page and other youtube pages that aren't /watch?

actually this plugin needs a lot of optimizations, like pre-adding channel names to related youtube videos in the side bar and home page

Post reply

Sign in to post a reply.