music only

try to take over the world!

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

// ==UserScript==
// @name         music only
// @namespace    http://tampermonkey.net/
// @include      https://www.youtube.com/
// @version      0.1
// @description  try to take over the world!
// @author       tuwuna
// @match        http://*/*
// @grant        none
// ==/UserScript==

setInterval(function() {
    'use strict';
    let a = document.getElementsByClassName('ytd-rich-grid-video-renderer');
    let size = a.length;
    for (let i = size - 1; i >= 0; i--) {
        if (a[i].id != 'dismissable') continue;
        let s = a[i].children[1].children[1].children[0].children[1].children[0].getAttribute('aria-label');
        if (s == null) continue;
        if (!s.includes(' - ')) a[i].remove();
    }
}, 100);