C0NPAQ / Youtube Channel Playlist

// ==UserScript==
// @name        Youtube Channel Playlist
// @description Script loads all the channels videos as current playlist, each time you view a video without a playlist - ATTENTION 01/2019 : Try pressing F5 if script doesn't load. It should though ... until new shit keeps coming up.
// @include       http*://*youtube.*/*
// @run-at      document-start
// @license MIT
// @author C0NPAQ
// ==/UserScript==

if ( /v=/.test(window.location.search) && ! /&list=/.test(window.location.search)) {

    window.location.replace( 
		  window.location.protocol + "//"
                + window.location.host
                + window.location.pathname
                + window.location.search
		+ "&feature=BFa&list=ULKwm-CtgFTb8&lf=mfu_in_order"
                + window.location.hash
		);
}


// SHIT SHAVER CODE
// or else, script will only load if you press F5 each time!

function fuckthatshit(a) 
{
        a.classList.remove('yt-simple-endpoint');
        a.classList.remove('yt-uix-redirect-link');
        
        // I don't know if this also breaks recommendations and tracking, but who cares about that?
        a.classList.remove('spf-link');
        a.removeAttribute('data-sessionlink');
        a.removeAttribute('rel');
        a.removeAttribute('data-visibility-tracking');
        a.removeAttribute('aria-hidden');
        old = a.href;
        if (a.title==old) a.title=a.href;
}
      
new MutationObserver(function(_,self) {
//        console.time('clean');
        for (let link of document.links) {
            if (!link.classList.contains('cleaned-by-youtube-channel-playlist-script')) {
                fuckthatshit(link);
                link.classList.add('cleaned-by-youtube-channel-playlist-script');
              	// a tad bit of gay ... turns the now blue links black or white depending on theme
                link.setAttribute("style", "text-decoration: none; font-size: 14px; ");
                if(link.id == "video-title") { link.setAttribute("style", "font-weight: 500; max-height: 999px; "+link.getAttribute("style")); }
              	if(document.getElementsByTagName("HTML")[0].getAttribute("dark") == "true") { link.setAttribute("style", "color: white; "+link.getAttribute("style")); }
              	else { link.setAttribute("style", "color: black; "+link.getAttribute("style")); }
            }
        }
//        console.timeEnd('clean');
}).observe(document, {childList:true, subtree:true});