Cleans URL's from various popular sites.
< General URL Cleanerについてのフィードバック
I've never actually seen a youtube redirect link like that before.
I think should work with this regex:
var youtubeRedirectLink = new RegExp(/^https?:\/\/www.youtube.com\/redirect\?q\=/);
And this case in the main cleaning function:
case youtubeRedirectLink.test(oldurl):
decodeURIComponent(oldurl.replace(youtubeRedirectLink,'').replace(/\&redir_token\=.*/,''));
break;
And this case in the main cleaning function:
It did not help me (
But the script YouTube Link Cleaner works, probably necessary to delete class="yt-uix-redirect-link"
I figured out why that script works and mine doesn't: There seems to be a script on youtube that keeps changing the links to a redirect link. And the script you linked keeps running the cleaning function every second, using window.setInterval(ChangeLinks, 1000);
I'd rather try to use something like MutationObserver to detect when the links are modified, and modify them back, so that it doesn't eat CPU time running the function over and over again if it doesn't have to.
edit
Scratch that, I noticed that the links don't actually change until you click on them. And all I need to do is remove the class to prevent them from doing so. I just added this and it seems to work:
else if(links[i].class="yt-uix-redirect-link") links[i].removeAttribute("class");
And it doesn't have to keep observing page changes or run the function again.
cratch that, I noticed that the links don't actually change until you click on them. And all I need to do is remove the class to prevent them from doing so. I just added this and it seems to work:
No ( Redirects remain in the current version. In previous (2.0.3.2 w/o youtube player control) - no redirects.
ps. But in FF v40.0.2 works now, unlike Opera v32,33 or Chrome v44
OK, it looks like:
if (links[i].className.contains("yt-uix-redirect-link")
Only works in Firefox, while:
if (links[i].class="yt-uix-redirect-link")
Seems to work in Firefox and Opera.
In the version where youtube HTML5 player controls disappeared, it was just removing the class property from all page links.
In the version where youtube HTML5 player controls disappeared, it was just removing the class property from all page links.
Again youtube play controls removed in Opera/Chrome/FF \
OK, I'm not gonna lie, this has actually been kinda pissing me off. But I think I've finally got it:
if (/ytp-button$/.test(links[i].className) == false) links[i].removeAttribute('class');
I tested that in Opera and Firefox.
I still don't know why it was breaking the HTML5 player buttons with
if (links[i].class="yt-uix-redirect-link")
given that they don't actually have that class name.
But I think I've finally got it:
Yes, with Youtube all ok now, thanks. But all links to amazon in google search result now look so (checked on Opera & FF):
I remember fixing that one on Amazon's own website, but looks like I forgot to do it for google and bing.
New version - on Opera/Chrome again youtube redirects \
I forgot to actually put in the youtubeClasses regex I made on greasyfork. I'm annoyed at myself for that.
On Youtube, page links with redirect (
Opera 31.0.1889.98 beta/Tampermonkey