在视频详情页面隐藏YouTube Shorts

通过将显示设置为“无”和高度设置为零来隐藏YouTube Shorts

  1. // ==UserScript==
  2. // @name Hide YouTube Shorts Shelf in the video detailed page
  3. // @description Hides the YouTube Shorts shelf by setting display to none and height to zero
  4. // @name:ar إخفاء رف YouTube Shorts في صفحة تفاصيل الفيديو
  5. // @description:ar يخفي رف YouTube Shorts عن طريق تعيين العرض إلى "لا شيء" والارتفاع إلى صفر
  6. // @name:bg Скриване на рафта YouTube Shorts на страницата с подробности за видеото
  7. // @description:bg Скрива рафта YouTube Shorts чрез задаване на дисплей на "няма" и височина на нула
  8. // @name:cs Skrýt poličku YouTube Shorts na stránce s podrobnostmi videa
  9. // @description:cs Skryje poličku YouTube Shorts nastavením zobrazení na "žádné" a výšky na nulu
  10. // @name:da Skjul YouTube Shorts-hylden på videoens detaljeside
  11. // @description:da Skjuler YouTube Shorts-hylden ved at sætte visning til "ingen" og højde til nul
  12. // @name:de YouTube Shorts-Regal auf der Videodetailseite ausblenden
  13. // @description:de Blendet das YouTube Shorts-Regal aus, indem die Anzeige auf "none" und die Höhe auf null gesetzt wird
  14. // @name:el Απόκρυψη του ραφιού YouTube Shorts στη σελίδα λεπτομερειών βίντεο
  15. // @description:el Αποκρύπτει το ράφι YouTube Shorts ορίζοντας την εμφάνιση σε "κανένα" και το ύψος σε μηδέν
  16. // @name:en Hide YouTube Shorts Shelf in the video detailed page
  17. // @description:en Hides the YouTube Shorts shelf by setting display to none and height to zero
  18. // @name:eo Kaŝi YouTube Shorts Breto en la Video-Detala Paĝo
  19. // @description:eo Kaŝas la YouTube Shorts-breton per agordo de montrado al "neniu" kaj alteco al nulo
  20. // @name:es Ocultar el estante de YouTube Shorts en la página de detalles del video
  21. // @description:es Oculta el estante de YouTube Shorts configurando la visualización a "ninguno" y la altura a cero
  22. // @name:fi Piilota YouTube Shorts -hylly videon yksityiskohtaisella sivulla
  23. // @description:fi Piilottaa YouTube Shorts -hyllyn asettamalla näytön arvoksi "ei mitään" ja korkeudeksi nolla
  24. // @name:fr Masquer l’étagère YouTube Shorts sur la page détaillée de la vidéo
  25. // @description:fr Masque l’étagère YouTube Shorts en définissant l’affichage sur "aucun" et la hauteur à zéro
  26. // @name:fr-CA Cacher l’étagère YouTube Shorts sur la page détaillée de la vidéo
  27. // @description:fr-CA Cache l’étagère YouTube Shorts en réglant l’affichage à "aucun" et la hauteur à zéro
  28. // @name:he הסתר את מדף YouTube Shorts בדף הפרטים של הסרטון
  29. // @description:he מסתיר את מדף YouTube Shorts על ידי הגדרת התצוגה ל"ללא" והגובה לאפס
  30. // @name:hr Sakrij policu YouTube Shorts na stranici s detaljima videa
  31. // @description:hr Sakriva policu YouTube Shorts postavljanjem prikaza na "nema" i visine na nulu
  32. // @name:hu YouTube Shorts polc elrejtése a videó részletes oldalán
  33. // @description:hu Elrejti a YouTube Shorts polcot a megjelenítés "nincs"-re és a magasság nullára állításával
  34. // @name:id Sembunyikan Rak YouTube Shorts di Halaman Detail Video
  35. // @description:id Menyembunyikan rak YouTube Shorts dengan mengatur tampilan ke "tidak ada" dan tinggi ke nol
  36. // @name:it Nascondi lo scaffale YouTube Shorts nella pagina dei dettagli del video
  37. // @description:it Nasconde lo scaffale YouTube Shorts impostando il display su "nessuno" e l’altezza a zero
  38. // @name:ja ビデオ詳細ページでYouTube Shortsシェルフを非表示
  39. // @description:ja YouTube Shortsシェルフをディスプレイを「なし」に、高さをゼロに設定して非表示にします
  40. // @name:ka YouTube Shorts-ის თაროს დამალვა ვიდეოს დეტალურ გვერდზე
  41. // @description:ka მალავს YouTube Shorts-ის თაროს ჩვენების "არაფერი"-ზე და სიმაღლის ნულზე დაყენებით
  42. // @name:ko 비디오 상세 페이지에서 YouTube Shorts 선반 숨기기
  43. // @description:ko YouTube Shorts 선반을 디스플레이를 "없음"으로, 높이를 0으로 설정하여 숨깁니다
  44. // @name:nb Skjul YouTube Shorts-hylle på videoens detaljside
  45. // @description:nb Skjuler YouTube Shorts-hyllen ved å sette visning til "ingen" og høyde til null
  46. // @name:nl Verberg de YouTube Shorts-plank op de videodetailpagina
  47. // @description:nl Verbergt de YouTube Shorts-plank door de weergave op "geen" en de hoogte op nul te zetten
  48. // @name:pl Ukryj półkę YouTube Shorts na stronie szczegółów wideo
  49. // @description:pl Ukrywa półkę YouTube Shorts, ustawiając wyświetlanie na "brak" i wysokość na zero
  50. // @name:pt-BR Ocultar a prateleira de YouTube Shorts na página de detalhes do vídeo
  51. // @description:pt-BR Oculta a prateleira de YouTube Shorts definindo a exibição como "nenhum" e a altura como zero
  52. // @name:ro Ascunde raftul YouTube Shorts pe pagina detaliată a videoclipului
  53. // @description:ro Ascunde raftul YouTube Shorts setând afișajul la "niciunul" și înălțimea la zero
  54. // @name:ru Скрыть полку YouTube Shorts на странице с подробностями видео
  55. // @description:ru Скрывает полку YouTube Shorts, устанавливая отображение на "нет" и высоту на ноль
  56. // @name:sk Skryť poličku YouTube Shorts na stránke s podrobnosťami videa
  57. // @description:sk Skryje poličku YouTube Shorts nastavením zobrazenia na "žiadne" a výšky na nulu
  58. // @name:sr Сакриј полицу YouTube Shorts на страници са детаљима видеа
  59. // @description:sr Сакрива полицу YouTube Shorts постављањем приказа на "нема" и висине на нулу
  60. // @name:sv Dölj YouTube Shorts-hylla på videons detaljsida
  61. // @description:sv Döljer YouTube Shorts-hyllan genom att ställa in visning till "ingen" och höjd till noll
  62. // @name:th ซ่อนชั้นวาง YouTube Shorts ในหน้าสำหรับรายละเอียดวิดีโอ
  63. // @description:th ซ่อนชั้นวาง YouTube Shorts โดยตั้งค่าการแสดงผลเป็น "ไม่มี" และความสูงเป็นศูนย์
  64. // @name:tr Video detay sayfasında YouTube Shorts Rafını Gizle
  65. // @description:tr YouTube Shorts rafını, görüntüyü "yok" ve yüksekliği sıfır yaparak gizler
  66. // @name:ug YouTube Shorts تاختىسىنى ۋىدېئونىڭ تەپسىلىي بېتىدە يوشۇرۇش
  67. // @description:ug YouTube Shorts تاختىسىنى كۆرسىتىشنى "يوق" قىلىپ، ئېگىزلىكىنى نۆلگە تەڭشەپ يوشۇرىدۇ
  68. // @name:uk Приховати полицю YouTube Shorts на сторінці з деталями відео
  69. // @description:uk Приховує полицю YouTube Shorts, встановлюючи відображення на "немає" і висоту на нуль
  70. // @name:vi Ẩn kệ YouTube Shorts trên trang chi tiết video
  71. // @description:vi Ẩn kệ YouTube Shorts bằng cách đặt hiển thị thành "không" và chiều cao thành số không
  72. // @name:zh 在视频详情页面隐藏YouTube Shorts
  73. // @description:zh 通过将显示设置为“无”和高度设置为零来隐藏YouTube Shorts
  74. // @name:zh-CN 在视频详情页面隐藏YouTube Shorts
  75. // @description:zh-CN 通过将显示设置为“无”和高度设置为零来隐藏YouTube Shorts
  76. // @name:zh-HK 在影片詳情頁面隱藏YouTube Shorts
  77. // @description:zh-HK 通過將顯示設為「無」同高度設為零來隱藏YouTube Shorts
  78. // @name:zh-SG 在视频详情页面隐藏YouTube Shorts
  79. // @description:zh-SG 通过将显示设置为“无”和高度设置为零来隐藏YouTube Shorts
  80. // @name:zh-TW 在影片詳細頁面隱藏YouTube Shorts
  81. // @description:zh-TW 透過將顯示設為「無」並將高度設為零來隱藏YouTube Shorts
  82. // @namespace http://tampermonkey.net/
  83. // @version 1.0.1.1
  84. // @author aspen138
  85. // @match *://www.youtube.com/*
  86. // @grant none
  87. // @run-at document-end
  88. // @icon https://www.youtube.com/favicon.ico
  89. // @license MIT
  90. // ==/UserScript==
  91.  
  92. (function() {
  93. 'use strict';
  94.  
  95. // Function to hide the Shorts shelf
  96. function hideShortsShelf() {
  97. // Select the Shorts shelf element
  98. const shortsShelf = document.querySelector('ytd-reel-shelf-renderer');
  99.  
  100. if (shortsShelf) {
  101. // Apply styles to hide the element
  102. shortsShelf.style.setProperty('display', 'none', 'important');
  103. shortsShelf.style.setProperty('height', '0', 'important');
  104. console.log('YouTube Shorts shelf has been hidden.');
  105. }
  106. }
  107.  
  108. // Initial attempt to hide the Shorts shelf
  109. hideShortsShelf();
  110.  
  111. // Observe changes in the DOM to hide the Shorts shelf if it loads later
  112. const observer = new MutationObserver((mutations) => {
  113. for (let mutation of mutations) {
  114. if (mutation.addedNodes.length) {
  115. hideShortsShelf();
  116. }
  117. }
  118. });
  119.  
  120. // Start observing the body for added nodes
  121. observer.observe(document.body, { childList: true, subtree: true });
  122.  
  123. })();