leetCode过滤器

LeetCode过滤器,过滤掉问题列表中的锁定的题目

Verze ze dne 05. 08. 2019. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         leetCode过滤器
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  LeetCode过滤器,过滤掉问题列表中的锁定的题目
// @author       [email protected]
// @match        https://leetcode-cn.com/problemset/all/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    let func = window.onload ;
    window.onload = ()=>{
        func && func();
        let observer = new MutationObserver((a,b)=>{
            Array.from(document.getElementsByTagName("tr"))
                .filter(item=>item.querySelectorAll("div>span>span").length>0)
                .forEach(item=>{item.style.display='none'});
        });
        let tb = document.querySelector(".category-group-base+div")
        let options = {
            'childList': true,
            "subtree":true,
        } ;
        observer.observe(tb, options);
    }
})();