YouTube Comments Delete Advanced

Convenient deletion of your comments on YouTube, on the comment history page https://www.youtube.com/feed/history/comment_history

Ekde 2024/04/02. Vidu La ĝisdata versio.

  1. // ==UserScript==
  2. // @name YouTube Comments Delete Advanced
  3. // @name:ru Удаление комментариев на YouTube (расширенный)
  4. // @name:de Erweitertes Löschen von YouTube-Kommentaren
  5. // @name:uk Розширене видалення коментарів на YouTube
  6. // @name:zh YouTube评论删除高级
  7. // @name:ja YouTubeコメント削除の高度な機能
  8. // @name:nl Geavanceerd verwijderen van YouTube-reacties
  9. // @name:pt Exclusão Avançada de Comentários do YouTube
  10. // @name:es Eliminación Avanzada de Comentarios de YouTube
  11. // @name:it Eliminazione Avanzata dei Commenti su YouTube
  12. // @name:ar حذف تعليقات YouTube المتقدمة
  13. // @name:fr Suppression avancée des commentaires YouTube
  14. // @name:pl Zaawansowane usuwanie komentarzy na YouTube
  15. // @name:az YouTube Şərhlərinin Ətraflı Silinməsi
  16. // @name:kz YouTube Пікірлерінің Кеңейтілген Жою
  17. // @name:hy YouTube-ի Դիտորդների Գրանցված Պատկերասրահները
  18. // @name:af YouTube Kommentaarverwydering Gevorderd
  19. // @name:ab YouTube-ре Комментариев Ирытхьит Къаьнапре
  20. // @name:bn ইউটিউব মন্তব্য মুছে দেওয়ার উন্নত বিষয়বস্তু
  21. // @name:bs Napredno brisanje komentara na YouTube-u
  22. // @name:ka YouTube-ის კომენტარების გაუქმების გაფართოება
  23. // @name:da Avanceret sletning af kommentarer på YouTube
  24. // @name:he מחיקת תגובות מתקדמת ביוטיוב
  25. // @name:yi אויפפירן קאָמענטאַרן אויף יוטוב אַדוואַנסירט
  26. // @name:id Penghapusan Komentar YouTube yang Lanjutan
  27. // @name:is Áframhaldandi Eyðing á Athugasemdum á YouTube
  28. // @name:kk YouTube Пікірлерінің Қиындылығы
  29. // @name:ky YouTube Комментарийлерди Өчүрүүнүн кеңири
  30. // @name:km ការលុបមតិយោបល់នៅលើ YouTube ដោយកម្រិតខ្ពស់
  31. // @name:et Edasijõudnud YouTube'i kommentaaride kustutamine
  32. // @name:lv YouTube Komentāru Papildināts Dzēšana
  33. // @name:lt Pažangus „YouTube“ komentarų trynimas
  34. // @name:ce YouTube-до Шхаштунаьхнах комментариев яцагийн
  35. // @name:hi YouTube पर टिप्पणियों का उन्नत रूप से हटाना
  36. // @name:tk YouTube-da maglumatlaryň gowjaňlaýyn
  37. // @name:tr YouTube Yorumlarınızın Gelişmiş Silinmesi
  38. // @name:uz YouTube Sharhlaringizni Gelişgan o'chirish
  39. // @name:fa حذف پیشرفته نظرات یوتیوب
  40. // @name:el Προηγμένη διαγραφή σχολίων στο YouTube
  41. // @name:be Расшыранае выдаленне каментароў на YouTube
  42. // @description Convenient deletion of your comments on YouTube, on the comment history page https://www.youtube.com/feed/history/comment_history
  43. // @description:ru Удобное удаление своих комментариев на YouTube, на странице истории https://www.youtube.com/feed/history/comment_history
  44. // @description:de Bequemes Löschen Ihrer Kommentare auf YouTube auf der Kommentarverlauf-Seite https://www.youtube.com/feed/history/comment_history
  45. // @description:uk Зручне видалення ваших коментарів на YouTube, на сторінці історії коментарів https://www.youtube.com/feed/history/comment_history
  46. // @description:zh 在YouTube上方便删除您的评论,位于评论历史页面 https://www.youtube.com/feed/history/comment_history
  47. // @description:ja YouTubeのコメント履歴ページhttps://www.youtube.com/feed/history/comment_historyで自分のコメントを便利に削除する
  48. // @description:nl Handig verwijderen van uw opmerkingen op YouTube, op de pagina met commentaargeschiedenis https://www.youtube.com/feed/history/comment_history
  49. // @description:pt Exclusão conveniente dos seus comentários no YouTube, na página de histórico de comentários https://www.youtube.com/feed/history/comment_history
  50. // @description:es Eliminación conveniente de sus comentarios en YouTube, en la página de historial de comentarios https://www.youtube.com/feed/history/comment_history
  51. // @description:it Comoda eliminazione dei tuoi commenti su YouTube, nella pagina della cronologia dei commenti https://www.youtube.com/feed/history/comment_history
  52. // @description:ar حذف مريح لتعليقاتك على YouTube، على صفحة تاريخ التعليقات https://www.youtube.com/feed/history/comment_history
  53. // @description:fr Suppression pratique de vos commentaires sur YouTube, sur la page d'historique des commentaires https://www.youtube.com/feed/history/comment_history
  54. // @description:pl Wygodne usuwanie swoich komentarzy na YouTube, na stronie historii komentarzy https://www.youtube.com/feed/history/comment_history
  55. // @description:az YouTube-da öz şərhlərinizin rahat silinməsi, şərhlərin tarix səhifəsində https://www.youtube.com/feed/history/comment_history
  56. // @description:kz YouTube-дағы комментарилеріңіздің оңтай өшіруі, комментарий тарихы бетінде https://www.youtube.com/feed/history/comment_history
  57. // @description:hy Ձեր մերժումների հեշտ ջնջումը YouTube- ում, մեկնաբանության պատմության էջում https://www.youtube.com/feed/history/comment_history
  58. // @description:af Gerieflike verwydering van jou kommentaar op YouTube, op die kommentaar geskiedenis bladsy https://www.youtube.com/feed/history/comment_history
  59. // @description:ab ГӀавзендагаш вашхӀа комментариеваш на YouTube, на страницан лхарьваруш https://www.youtube.com/feed/history/comment_history
  60. // @description:bn ইউটিউবে আপনার মন্তব্যগুলি সুবিধাজনকভাবে মুছে ফেলা, মন্তব্যের ইতিহাস পৃষ্ঠায় https://www.youtube.com/feed/history/comment_history
  61. // @description:bs Prikladno brisanje vaših komentara na YouTubeu, na stranici povijesti komentara https://www.youtube.com/feed/history/comment_history
  62. // @description:ka თქვენი კომენტარების წაშლა YouTube- ზე, კომენტარების ისტორიის გვერდზე https://www.youtube.com/feed/history/comment_history
  63. // @description:da Bequemes Löschen Ihrer Kommentare auf YouTube auf der Kommentarverlauf-Seite https://www.youtube.com/feed/history/comment_history
  64. // @description:he מחיקה נוחה של ההערות שלך ב- YouTube, בדף ההיסטוריית ההערות https://www.youtube.com/feed/history/comment_history
  65. // @description:yi געמיטלעך פון דיין קאָמענטאַרן אויפן יוטוב, אויף די קאָמענט ארכיו זײַט https://www.youtube.com/feed/history/comment_history
  66. // @description:id Penghapusan komentar YouTube Anda yang nyaman, di halaman riwayat komentar https://www.youtube.com/feed/history/comment_history
  67. // @description:is Þægilegt eyða athugasemdum þínum á YouTube, á athugasemdarsögu síðunni https://www.youtube.com/feed/history/comment_history
  68. // @description:kk YouTube-дегі пікірлеріңіздің ыңғай жоюы, пікірлер тарихы бетінде https://www.youtube.com/feed/history/comment_history
  69. // @description:ky YouTube-дагы комментарийлериңизди колдонмонун тарыхы бетиндеги ыңғайтуу өчүргүлөрү https://www.youtube.com/feed/history/comment_history
  70. // @description:km ការលុបស្ថានភាពរបស់លោកអ្នកនៅលើយូធូប YouTube, នៅលើទំព័រប្រវត្តិសាស្ត្រនៃយូធូប https://www.youtube.com/feed/history/comment_history
  71. // @description:et Teie kommentaaride mugav kustutamine YouTube'is, kommentaaride ajaloo lehel https://www.youtube.com/feed/history/comment_history
  72. // @description:lv Jūsu komentāru ērta dzēšana YouTube, komentāru vēstures lapā https://www.youtube.com/feed/history/comment_history
  73. // @description:lt Patogus jūsų komentarų šalinimas „YouTube“, komentarų istorijos puslapyje https://www.youtube.com/feed/history/comment_history
  74. // @description:ce YouTube-са бакъыт вац сацарыгӀ комментариев хьа егатарш, комментариев тариххаш https://www.youtube.com/feed/history/comment_history
  75. // @description:hi यूट्यूब पर अपने टिप्पणियों को सुविधाजनक रूप से हटाना, टिप्पणी इतिहास पृष्ठ पर https://www.youtube.com/feed/history/comment_history
  76. // @description:tk YouTube-da öz diňe kommentlerinizi gowjaňlaýyn, kommentler tarapyndan geçirýän sahypa https://www.youtube.com/feed/history/comment_history
  77. // @description:tr YouTube'daki yorumlarınızı rahatça silme, yorum geçmişi sayfasında https://www.youtube.com/feed/history/comment_history
  78. // @description:uz Sizning fikrlaringizni YouTube-da qulay o'chirish, fikrlar tarixi sahifasida https://www.youtube.com/feed/history/comment_history
  79. // @description:fa حذف راحت نظرات شما در YouTube، در صفحه تاریخچه نظرات https://www.youtube.com/feed/history/comment_history
  80. // @description:el Εύκολη διαγραφή των σχολίων σας στο YouTube, στη σελίδα ιστορικού σχολίων https://www.youtube.com/feed/history/comment_history
  81. // @description:be Зручнае выдаленне вашых каментараў на YouTube, на старонцы гісторыі каментароў https://www.youtube.com/feed/history/comment_history
  82. // @namespace https://greatest.deepsurf.us/users/1221433
  83. // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  84. // @version 1.1
  85. // @author Sitego
  86. // @match *://myactivity.google.com/*
  87. // @grant GM_getResourceText
  88. // @license MIT
  89. // @category YouTube
  90. // ==/UserScript==
  91.  
  92. (function () {
  93. 'use strict';
  94. function addButtons() {
  95. var deleteButtons = document.querySelectorAll('.VfPpkd-Bz112c-LgbsSe');
  96. deleteButtons.forEach(function (button) {
  97. if (!button.closest('[aria-haspopup="menu"]')) {
  98. if (!button.parentNode.querySelector('.comment-checkbox')) {
  99. var checkbox = document.createElement('input');
  100. checkbox.type = 'checkbox';
  101. checkbox.className = 'comment-checkbox';
  102. button.parentNode.insertBefore(checkbox, button);
  103. checkbox.addEventListener('change', function () {
  104. updateDeleteButtonState();
  105. });
  106. checkbox.addEventListener('mouseover', function (event) {
  107. handleCheckboxMouseover(event, checkbox);
  108. });
  109. }
  110. }
  111. });
  112. if (!document.querySelector('.delete-all-button')) {
  113. var deleteAllButton = document.createElement('button');
  114. deleteAllButton.textContent = 'Delete Selected Comments';
  115. deleteAllButton.className = 'delete-all-button';
  116. deleteAllButton.disabled = true;
  117. deleteAllButton.addEventListener('click', function () {
  118. deleteSelectedComments();
  119. });
  120. if (deleteButtons.length > 0) {
  121. deleteButtons[0].parentNode.parentNode.insertBefore(deleteAllButton, deleteButtons[0].parentNode);
  122. }
  123. }
  124. if (!document.querySelector('.select-all-button')) {
  125. var selectAllButton = document.createElement('button');
  126. selectAllButton.textContent = 'Select All';
  127. selectAllButton.className = 'select-all-button';
  128. selectAllButton.addEventListener('click', function () {
  129. selectAllCheckboxes();
  130. });
  131. if (deleteButtons.length > 0) {
  132. deleteButtons[0].parentNode.parentNode.insertBefore(selectAllButton, deleteButtons[0].parentNode);
  133. }
  134. }
  135. if (!document.querySelector('.clear-all-button')) {
  136. var clearAllButton = document.createElement('button');
  137. clearAllButton.textContent = 'Clear All';
  138. clearAllButton.className = 'clear-all-button';
  139. clearAllButton.addEventListener('click', function () {
  140. clearAllCheckboxes();
  141. });
  142. if (deleteButtons.length > 0) {
  143. deleteButtons[0].parentNode.parentNode.insertBefore(clearAllButton, deleteButtons[0].parentNode);
  144. }
  145. }
  146. }
  147. function updateDeleteButtonState() {
  148. var deleteAllButton = document.querySelector('.delete-all-button');
  149. var checkboxes = document.querySelectorAll('.comment-checkbox');
  150. var anyChecked = Array.from(checkboxes).some(function (checkbox) {
  151. return checkbox.checked;
  152. });
  153. if (deleteAllButton) {
  154. if (anyChecked) {
  155. deleteAllButton.removeAttribute('disabled');
  156. } else {
  157. deleteAllButton.setAttribute('disabled', 'disabled');
  158. }
  159. }
  160. }
  161. function deleteSelectedComments() {
  162. var checkboxes = document.querySelectorAll('.comment-checkbox');
  163. checkboxes.forEach(function (checkbox) {
  164. if (checkbox.checked) {
  165. var deleteButton = checkbox.nextElementSibling;
  166. deleteButton.click();
  167. }
  168. });
  169. }
  170. function selectAllCheckboxes() {
  171. var checkboxes = document.querySelectorAll('.comment-checkbox');
  172. checkboxes.forEach(function (checkbox) {
  173. checkbox.checked = true;
  174. });
  175. updateDeleteButtonState();
  176. }
  177. function clearAllCheckboxes() {
  178. var checkboxes = document.querySelectorAll('.comment-checkbox');
  179. checkboxes.forEach(function (checkbox) {
  180. checkbox.checked = false;
  181. });
  182. updateDeleteButtonState();
  183. }
  184. function handleCheckboxMouseover(event, currentCheckbox) {
  185. if (currentCheckbox.checked) {
  186. currentCheckbox.checked = false;
  187. } else {
  188. currentCheckbox.checked = true;
  189. }
  190. }
  191. window.addEventListener('load', function () {
  192. addButtons();
  193. });
  194. document.addEventListener('DOMSubtreeModified', function () {
  195. updateDeleteButtonState();
  196. addButtons();
  197. });
  198. var buttonStyles = document.createElement('style');
  199. buttonStyles.textContent = `
  200. .delete-all-button, .select-all-button, .clear-all-button {
  201. position: fixed;
  202. top: 50%;
  203. right: 20px;
  204. transform: translateY(-50%);
  205. background-color: red;
  206. color: white;
  207. padding: 10px 20px;
  208. border: none;
  209. border-radius: 5px;
  210. cursor: pointer;
  211. z-index: 9999;
  212. margin-bottom: 10px;
  213. font-weight: bold;
  214. }
  215. .delete-all-button:hover, .select-all-button:hover, .clear-all-button:hover {
  216. background-color: #777;
  217. }
  218. .select-all-button {
  219. top: 40%;
  220. background-color: #1988FF;
  221. font-weight: bold;
  222. }
  223. .clear-all-button {
  224. top: 60%;
  225. background-color: #1DA044;
  226. font-weight: bold;
  227. }
  228. `;
  229. document.head.appendChild(buttonStyles);
  230. var checkboxStyles = document.createElement('style');
  231. checkboxStyles.textContent = `
  232. .comment-checkbox {
  233. -webkit-appearance: none;
  234. -moz-appearance: none;
  235. appearance: none;
  236. width: 24px;
  237. height: 24px;
  238. border: 2px solid #ccc;
  239. border-radius: 5px;
  240. cursor: pointer;
  241. float: right;
  242. margin-top: 10px;
  243. }
  244.  
  245. .comment-checkbox:checked {
  246. background-color: #007bff;
  247. border-color: #007bff;
  248. }
  249.  
  250. .comment-checkbox:checked::after {
  251. content: '\\2713';
  252. font-size: 18px;
  253. color: white;
  254. margin-left: 4px;
  255. }
  256. .comment-checkbox:hover {
  257. background-color: #007bff;
  258. }
  259. `;
  260. document.head.appendChild(checkboxStyles);
  261. })();