LeetCode 題目篩選與隱藏面板

添加 LeetCode 進階篩選(難度/隱藏題目/進度卡片)。

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

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

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

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

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

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

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

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

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

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

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

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

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

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

作者
hi4444
今日安裝
0
安裝總數
1
評價
0 0 0
版本
1.4
建立日期
2026-04-14
更新日期
2026-04-15
尺寸
22.8 KB
授權條款
未知
腳本執行於

Additional Info — LeetCode Pro Filter Suite (Stable Fix)

This userscript enhances the LeetCode Problemset page by adding a lightweight, client-side filtering system and a live progress dashboard. It is designed to run automatically after installation via Greasy Fork or any userscript manager (Tampermonkey / Violentmonkey).


🧩 What This Script Does

Once installed, the script automatically activates when you open:

https://leetcode.com/problemset/

It then:

  • Injects a custom control panel into the sidebar
  • Scans the problem table in real time
  • Applies user-defined filters instantly
  • Tracks your progress from the visible LeetCode UI
  • Saves all preferences locally in your browser

No setup, configuration, or login is required.


⚙️ Core Functionality (In Detail)

🔍 1. Problem Filtering Engine

The script continuously scans DOM rows representing problems and filters them based on:

  • Difficulty level (Easy / Medium / Hard)
  • Locked problems (premium content)
  • Completed problems (already solved)
  • Daily challenges (optional exclusion)

Filtering happens instantly when:

  • The page loads
  • New problems are dynamically inserted
  • You toggle any filter button

🚫 2. Visibility Control System

Each filter works by applying a hidden CSS class:

  • Problems are NOT deleted
  • They are only hidden using display: none !important
  • This ensures zero interference with LeetCode logic

This makes the system:

  • Safe
  • Reversible
  • Non-destructive

📊 3. Live Progress Dashboard

A circular progress indicator is injected into the sidebar.

It:

  • Reads your solved/total count from the LeetCode UI
  • Parses text dynamically (e.g. 123 / 345)
  • Updates automatically every few seconds
  • Animates a circular SVG progress ring

The progress ring:

  • Fills proportionally to completion percentage
  • Updates without refreshing the page
  • Reflects real-time changes in your account progress

💾 4. Persistent Settings (Local Storage)

All toggles are stored in:

localStorage → lc_pro_suite_settings_v6

This includes:

  • Hidden locked problems setting
  • Hidden completed problems setting
  • Difficulty filters
  • Panel collapse state

Your settings remain saved even after:

  • Refreshing the page
  • Closing the browser
  • Restarting your device

🚀 Performance Design

The script is optimized for speed:

  • Uses a MutationObserver instead of polling
  • Batch-scans DOM updates
  • Avoids unnecessary re-renders
  • Minimizes layout thrashing
  • Prevents duplicate processing of rows

This ensures:

  • Low CPU usage
  • Smooth scrolling
  • No UI lag on large problem lists

🔐 Safety & Privacy

This script:

  • Does NOT send any data externally
  • Does NOT track user activity
  • Does NOT modify LeetCode backend requests
  • Runs entirely in your browser
  • Uses only localStorage for preferences

It is fully offline-safe and privacy-respecting.


🌐 Browser Compatibility

Works with:

  • Desktop Chrome
  • Microsoft Edge
  • Firefox
  • Opera GX (fully supported via Tampermonkey)

Note: On Opera GX, install a userscript manager extension first (such as Tampermonkey) to enable script execution. Unsure about Violentmonkey extension


📌 Summary

This script enhances LeetCode by adding:

  • Smart filtering system
  • Live progress visualization
  • Persistent UI customization
  • Lightweight DOM optimization

All without changing LeetCode’s core functionality.