leetCode过滤器

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

Tính đến 05-08-2019. Xem phiên bản mới nhất.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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

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

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

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

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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.

(I already have a user style manager, let me install it!)

// ==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);
    }
})();