annnoyboy / Old YouTube Layout

// ==UserScript==
// @name         Old YouTube Layout
// @version      1.0 (release)
// @description  Tweaks the URL a little bit and bring backs the old YouTube layout again.
// @author       annoyboy
// @match        https://*.youtube.com/*
// @exclude      https://*.youtube.com/embed
// @run-at       document-start
// @license      MIT
// ==/UserScript==

(function() {
    // Stops the loading of the webpage to save internet data
    document.execCommand('stop');

    var cur_url = new window.URL(location.href);

    // This sets 'display_polymer' to 'true' to enable old youtube layout.
    cur_url.searchParams.set('disable_polymer', 'true');

    // This is a checkpoint to redirect the page or not!
    if(window.location.href != cur_url.href)
        window.location.href = cur_url.href;
})();