Greasy Fork

Greasy Fork is available in English.

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

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

/* 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'
        }
      }
    }
  })
})()