An improved version of Zalastax's fixed version of gorhill's tool to whitelist ads for certain YouTubers
< 脚本YouTube uBlock Whitelister (Improved)的反馈
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) : '';
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
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址
Doesn't work, small error.
Change line 36 from
var channelId = fetchChannel();
to
var channel = fetchChannel();