YouTube New UI

YouTube new UI with dark mode

2017/05/02のページです。最新版はこちら

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         YouTube New UI
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  YouTube new UI with dark mode
// @compatible      chrome
// @compatible      firefox
// @icon            https://lh3.googleusercontent.com/-dxYwJeI5kBA/WQgTuZcR6mI/AAAAAAAAANk/UDnxV3I8TgUMdLRfBhomG2JtnaVeoewFgCLcB/h120/YOUTUBENEWUI.ico
// @author       instaer
// @match        *://www.youtube.com/*
// @run-at          document-start
// @grant        GM_getValue
// ==/UserScript==

(function() {
    'use strict';
    if(getCookie("VISITOR_INFO1_LIVE") !== null && getCookie("VISITOR_INFO1_LIVE") !== ""){
        console.log(getCookie("VISITOR_INFO1_LIVE"));
    }else{
        var Days = 7;
        var exp = new Date();
        exp.setTime(exp.getTime() + Days*24*60*60*1000);
        document.cookie="VISITOR_INFO1_LIVE=fPQ4jCL6EiE;expires=" + exp.toGMTString();
        setTimeout(function() {
            refresh();
        }, 960);
    }
    function getCookie(cookieName) {
        var strCookie = document.cookie;
        var arrCookie = strCookie.split("; ");
        for(var i = 0; i < arrCookie.length; i++){
            var arr = arrCookie[i].split("=");
            if(cookieName == arr[0]){
                return arr[1];
            }
        }
        return "";
    }
    function refresh(){
        var url = window.location.href;
        console.log(url);
        var once = url.split("#");
        if (once[1] != 1) {
            url += "#1";
            self.location.replace(url);
            window.location.reload();
        }
    }
    // Your code here...
})();