Youtube Watch Page Fix

Removes the recent changes to YouTube's watch page

当前为 2022-05-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Youtube Watch Page Fix
  3. // @namespace lightbeam
  4. // @version 1.0.1
  5. // @description Removes the recent changes to YouTube's watch page
  6. // @author lightbeam
  7. // @match *://www.youtube.com/*
  8. // @grant none
  9. // @license MIT License
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. ApplyCSS();
  14.  
  15. function ApplyCSS() {
  16. var styles = document.createElement("style");
  17. styles.innerHTML=`
  18. /* Temporary fixes. THESE WILL NOT WORK THE NEXT TIME YOUTUBE UPDATES ITS CODE. */
  19. ytd-watch-metadata {
  20. display: none !important;
  21. }
  22. #meta-contents[hidden], #info-contents[hidden] {
  23. display: block !important;
  24. }
  25.  
  26.  
  27. /* Permanent fixes. For when the temporary fixes stop working. */
  28. /* Removes second comment section, */
  29. #comment-teaser.ytd-watch-metadata {
  30. display: none;
  31. }
  32. /* Removes border around creator's name and sub button. NOTE: This part doesn't work anymore, but keeping it for now just in case it starts working again. */
  33. #owner.ytd-watch-metadata {
  34. border: none;
  35. }
  36. /* Removes border around creator's name and sub button. */
  37. ytd-watch-metadata:not([modern-metapanel]) #owner.ytd-watch-metadata {
  38. border: none;
  39. }
  40. /* Reverts the video title font. */
  41. ytd-watch-metadata[smaller-yt-sans-light-title] h1.ytd-watch-metadata {
  42. font-family: "Roboto",sans-serif;
  43. font-weight: 400;
  44. font-size: 18px;
  45. }
  46. ytd-video-primary-info-renderer[use-yt-sans20-light] .title.ytd-video-primary-info-renderer {
  47. font-family: "Roboto",sans-serif;
  48. font-weight: 400;
  49. font-size: 18px;
  50. }
  51. /* Removes the bold letters on upload date and view count. */
  52. .yt-formatted-string[style-target="bold"] {
  53. font-weight: 400;
  54. }`
  55. document.head.appendChild(styles);
  56. }
  57. })();