Youtube Logo - Link to subscriptions feed

Changes the YouTube logo to link to user"s subscription feed instead of homepage (script only works if you are signed in) The original author: tolanri @ http://userscripts-mirror.org/users/518143

目前为 2015-11-12 提交的版本,查看 最新版本

// ==UserScript==
// @name            Youtube Logo - Link to subscriptions feed
// @namespace       Youtube Logo - Link to subscriptions feed
// @description     Changes the YouTube logo to link to user"s subscription feed instead of homepage (script only works if you are signed in) The original author: tolanri @ http://userscripts-mirror.org/users/518143
// @version         1.0.5
// @include         http://*.youtube.tld/*
// @include         https://*.youtube.tld/*
// @supportURL      https://greasyfork.org/en/scripts/13582/feedback
// @author          aciidic
// ==/UserScript==


document.addEventListener('DOMNodeInserted', function() {
    try{
        var logo = document.getElementById("logo-container");                               // Get YouTube logo element
        var signedin = document.getElementById("yt-masthead-user") != null;                 // Check user is logged in
        var checklink = (new RegExp('/feed/subscriptions')).test(logo.href) == false;       // Check if YouTube logo URL needs to be changed

        if (signedin && checklink) {
            logo.href = "/feed/subscriptions";
        }
    } catch(e){
        console.log("Could not set YouTube logo URL...");
        console.log(e);
    }
}, false);