Youtube wadsworth

Displays a wadsworth button to activate it

  1. // ==UserScript==
  2. // @name Youtube wadsworth
  3. // @namespace http://userscripts.org/users/127069
  4. // @description Displays a wadsworth button to activate it
  5. // @include http*://*.youtube.com/watch?*v=*
  6. // @version 2.3
  7. // @changelog Fixed non-working button and style
  8. // ==/UserScript==
  9.  
  10. var wadsworthSpan = document.createElement("span");
  11. wadsworthSpan.className = "yt-uix-button-group actionable";
  12. var wadsworth = document.createElement("button");
  13. wadsworth.innerHTML = "Wadsworth";
  14. wadsworth.setAttribute("id", "wadsworth");
  15. wadsworth.setAttribute("role", "button");
  16. wadsworth.setAttribute("data-button-toggle", "true");
  17. wadsworth.setAttribute("type", "button");
  18. wadsworth.className = "yt-uix-button yt-uix-button-text yt-uix-tooltip yt-uix-button-empty";
  19.  
  20. var cPage = document.URL;
  21. if (cPage.indexOf("wadsworth") == -1) {
  22. wadsworth.addEventListener('click', function() { document.location = cPage + "&wadsworth=1"; }, false);
  23. } else {
  24. wadsworth.className = "yt-uix-button yt-uix-button-text yt-uix-tooltip yt-uix-button-empty action-panel-trigger yt-uix-button-toggled";
  25. wadsworth.setAttribute("style", "color: rgb(169, 56, 46) !important;");
  26. var patt = /(.+)&wadsworth=1/i;
  27. wadsworth.addEventListener('click', function () { document.location = cPage.match(patt)[1]; }, false);
  28. document.getElementById('watch7-action-buttons').parentNode.addEventListener('mouseover', function () { wadsworth.style.boxShadow = 'inset 0 1px 1px rgba(0,0,0,.20)'}, false);
  29. document.getElementById('watch7-action-buttons').parentNode.addEventListener('mouseout', function () { wadsworth.style.boxShadow = ''}, false);
  30. }
  31.  
  32. wadsworthSpan.appendChild(wadsworth);
  33. document.getElementById("watch7-sentiment-actions").appendChild(wadsworthSpan);
  34.  
  35. GM_addStyle("#wadsworth {\
  36. border: 0px none;} \
  37. .yt-uix-button-panel:hover \
  38. #wadsworth {\
  39. border: 1px solid;\
  40. border-color: #C6C6C6;}");

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址