Enhance titles - YouTube

Hide watched videos on YouTube

  1. // Enhance titles - YouTube
  2. //
  3. // Hide watched videos on YouTube
  4. //
  5. // https://gf.qytechs.cn/scripts/390633-enhance-titles-youtube
  6. // Copyright (C) 2019, Guido Villa
  7. //
  8. // For information/instructions on user scripts, see:
  9. // https://gf.qytechs.cn/help/installing-user-scripts
  10. //
  11. // --------------------------------------------------------------------
  12. //
  13. // ==UserScript==
  14. // @name Enhance titles - YouTube
  15. // @description Hide watched videos on YouTube
  16. // @version 1.4
  17. // @author guidovilla
  18. // @date 01.11.2019
  19. // @copyright 2019, Guido Villa (https://gf.qytechs.cn/users/373199-guido-villa)
  20. // @license GPL-3.0-or-later
  21. // @homepageURL https://gf.qytechs.cn/scripts/390633-enhance-titles-youtube
  22. // @supportURL https://gitlab.com/gv-browser/userscripts/issues
  23. // @contributionURL https://tinyurl.com/gv-donate-72
  24. //
  25. // @namespace https://gf.qytechs.cn/users/373199-guido-villa
  26. //
  27. // @match https://www.youtube.com/*
  28. //
  29. // @require https://gf.qytechs.cn/scripts/391648/code/userscript-utils.js
  30. // @require https://gf.qytechs.cn/scripts/390248/code/entry-list.js
  31. // ==/UserScript==
  32. //
  33. // --------------------------------------------------------------------
  34. //
  35. // To-do (priority: [H]igh, [M]edium, [L]ow):
  36. // - [L] hide selective titles?
  37. //
  38. // Changelog:
  39. // ----------
  40. // 2019.11.01 [1.4] Cleanups&optimizations
  41. // 2019.10.05 [1.3] Fix completion status appearing later (after ELProcessed)
  42. // 2019.10.03 [1.2] Refactor using EntryList library
  43. // 2019.09.30 [1.1] First public version, correct @namespace and other headers
  44. // 2019.06.17 [1.0] First version
  45. //
  46. // --------------------------------------------------------------------
  47.  
  48. /*jshint -W008 */
  49. /* global EL: readonly */
  50.  
  51. (function() {
  52. 'use strict';
  53.  
  54. /* BEGIN CONTEXT DEFINITION */
  55.  
  56. var youtube = EL.newContext('YouTube');
  57.  
  58.  
  59. youtube.getPageEntries = function() {
  60. return document.querySelectorAll('a#thumbnail');
  61. };
  62.  
  63.  
  64. youtube.isValidEntry = function(entry) {
  65. var st = entry.querySelector('#overlays');
  66. return !!(st && st.innerHTML);
  67. };
  68.  
  69.  
  70. youtube.determineType = function(_I_lists, _I_entryData, entry) {
  71. var st = entry.querySelector('#overlays #progress');
  72. return (st && st.style.width == "100%");
  73. };
  74.  
  75.  
  76. youtube.processItem = function(entry, _I_entryData, _I_processingType) {
  77. entry.style.opacity = .1;
  78. };
  79.  
  80. /* END CONTEXT DEFINITION */
  81.  
  82.  
  83.  
  84. //-------- "main" --------
  85. EL.startup(youtube);
  86.  
  87. })();

QingJ © 2025

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