YouTube New UI

YouTube new UI with dark mode

Verze ze dne 02. 05. 2017. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name YouTube New UI
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description YouTube new UI with dark mode
  6. // @compatible chrome
  7. // @compatible firefox
  8. // @icon https://lh3.googleusercontent.com/-dxYwJeI5kBA/WQgTuZcR6mI/AAAAAAAAANk/UDnxV3I8TgUMdLRfBhomG2JtnaVeoewFgCLcB/h120/YOUTUBENEWUI.ico
  9. // @author instaer
  10. // @match *://www.youtube.com/*
  11. // @run-at document-start
  12. // @grant GM_getValue
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17. if(getCookie("VISITOR_INFO1_LIVE") !== null && getCookie("VISITOR_INFO1_LIVE") !== ""){
  18. console.log(getCookie("VISITOR_INFO1_LIVE"));
  19. }else{
  20. var Days = 7;
  21. var exp = new Date();
  22. exp.setTime(exp.getTime() + Days*24*60*60*1000);
  23. document.cookie="VISITOR_INFO1_LIVE=fPQ4jCL6EiE;expires=" + exp.toGMTString();
  24. setTimeout(function() {
  25. refresh();
  26. }, 960);
  27. }
  28. function getCookie(cookieName) {
  29. var strCookie = document.cookie;
  30. var arrCookie = strCookie.split("; ");
  31. for(var i = 0; i < arrCookie.length; i++){
  32. var arr = arrCookie[i].split("=");
  33. if(cookieName == arr[0]){
  34. return arr[1];
  35. }
  36. }
  37. return "";
  38. }
  39. function refresh(){
  40. var url = window.location.href;
  41. console.log(url);
  42. var once = url.split("#");
  43. if (once[1] != 1) {
  44. url += "#1";
  45. self.location.replace(url);
  46. window.location.reload();
  47. }
  48. }
  49. // Your code here...
  50. })();