leetCode过滤器

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         leetCode过滤器
// @namespace    http://tampermonkey.net/
// @version      1.1
// @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("td.question-status-column>div>i").length>0)
                .forEach(item=>{console.log(item);item.style.display='none'});
        });
        let tb = document.querySelector(".category-group-base+div")
        let options = {
            'childList': true,
            "subtree":true,
        } ;
        observer.observe(tb, options);
    }
})();