Greasy Fork is available in English.

力扣隐藏会员、面试、竞赛、剑指offer题

力扣隐藏会员、面试、竞赛(LCP)、剑指offer(LCR)题


安装此脚本?
/* eslint-disable no-undef */
// ==UserScript==
// @name         力扣隐藏会员、面试、竞赛、剑指offer题
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  力扣隐藏会员、面试、竞赛(LCP)、剑指offer(LCR)题
// @author       jzh
// @match        https://leetcode.cn/problemset/all/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @grant        none
// @require      http://code.jquery.com/jquery-3.x-git.min.js
// @license      MIT
// ==/UserScript==
;(function () {
'use strict'
const button = $('<button id="filter" type="button"></button>').text('筛选')
$('.min-w-full').prepend(button)
$('#filter').click(function () {
const list = document.getElementsByClassName('min-w-full')[0].children[2]
for (let i = list.children.length - 1; i >= 0; i--) {
const item = list.children[i]
if (item.children[0].hasChildNodes()) {
item.style.display = 'none'
} else {
const text = item.children[1].children[0].getElementsByTagName('a')[0].innerText
if (text.startsWith('LCR') || text.startsWith('LCP') || text.startsWith('面试题')) {
item.style.display = 'none'
}
}
}
})
})()