music only

try to take over the world!

目前为 2020-08-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name music only
  3. // @namespace http://tampermonkey.net/
  4. // @include https://www.youtube.com/
  5. // @version 0.1
  6. // @description try to take over the world!
  7. // @author tuwuna
  8. // @match http://*/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. setInterval(function() {
  13. 'use strict';
  14. let a = document.getElementsByClassName('ytd-rich-grid-video-renderer');
  15. let size = a.length;
  16. for (let i = size - 1; i >= 0; i--) {
  17. if (a[i].id != 'dismissable') continue;
  18. let s = a[i].children[1].children[1].children[0].children[1].children[0].getAttribute('aria-label');
  19. if (s == null) continue;
  20. if (!s.includes(' - ')) a[i].remove();
  21. }
  22. }, 100);