Helps whitelist YouTube channels in Adblock Plus
< Commentaires sur YouTube - whitelist channels in Adblock Plus
Yeah, not sure why but the latest version switched to a different way to change the url which doesn't reload the page. So no actual refreshing the page and reloading the ads happens.
Change this:var updateHref = function (url) {
window.history.replaceState(history.state, "", url);
};
to this:var updateHref = function (url) {
location.replace(url);
};
That seemed to do the trick. Thanks.
Yeah, not sure why but the latest version switched to a different way to change the url which doesn't reload the page.
Like I said in the change log, there was a suggestion to avoid the refresh, with one other person echoing the complaint. So I implemented that change, and got a thumbs up from said person.
I don't see how I'd make everybody happy in this situation, so I'm not going to revert the change.
I don't know why you wouldn't want it to refresh, since that's the only way to make the ads load properly. It does that because the url doesn't change to the whitelisted one until after the page loads, so you have to load the page again for the ads to load. The only way I can see to prevent the reload is to change the url before the page actually loads; but I don't know if that is even possible to do, since you get the channel name from the page itself. Maybe if you found a way to lookup the channel when clicking on the link and redirecting to the new url instead. The only disadvantage I could think of with that is that the code would have to test every link you click to see if it goes to youtube or not.
Suggested Change
This is most of the way there, but I suggest making it so that the page refreshes after it does it's thing, so that the ads will actually load. I tried to make it do it myself, but with my very rudimentary knowledge of Javascript, all I got was frustration.