🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/09 20:00:30
🔄 下次更新时间:2026/01/09 21:00:30
手动刷新缓存

LeetSession – Code obsession

Work-around for LeetCode’s removed “Session Management” feature (see issue #22883). It emulates the legacy behaviour by creating a self-updating favorite list that contains every problem and automatically syncs it.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

作者のサイトでサポートを受ける。または、このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
作者
wallandteen
1日のインストール数
0
累計インストール数
2
評価
0 0 0
バージョン
1.0.0
作成日
2025/07/29
更新日
2025/07/29
大きさ
19.3KB
ライセンス
MIT
対象サイト

Install with Tampermonkey License: MIT PRs welcome

LeetSession – Code obsession 🧠⚡️

Userscript that revives LeetCode’s removed “Session Management” workflow by emulating a brand-new sessions: it creates a self-updating favorite list containing every problem while leaving all other lists and your global progress untouched.
Works automatically on both leetcode.com/problemset/* and leetcode.com/problem-list/* pages. ⭐️ If you find the script useful, please give the repo a star — it really helps!

Table of Contents

  1. Why?
  2. Features
  3. Demo
  4. Installation
  5. Usage
  6. How It Works
  7. FAQ / Troubleshooting
  8. Contributing
  9. License
  10. Acknowledgements

Why?

In 2024 LeetCode silently disabled “Create” button in Session Management section globally
(issue #22883).

LeetSession brings the feature back without touching LeetCode’s backend data:

  • every click on New Session spawns a fresh private list that already contains all problems;
  • solved counters in that list are reset only once when creating a new session;
  • the list auto-syncs daily, so brand-new problems appear automatically without affecting your progress;
  • your existing favorite lists and overall profile stats remain exactly as they were.

Features

  • One-click "New Session" - Creates fresh problem list
  • Auto-naming - DD MMM YYYY [LS] format
  • Complete problem set - All 3600+ problems included
  • Daily auto-sync - Silent background updates
  • Zero side effects - Never touches other lists
  • Interruption recovery - Resumes if creation fails
  • Rate limit handling - Automatic retry with backoff

Demo

LeetSession screenshot

Installation

Prerequisite: a userscript manager such as Tampermonkey or Violentmonkey.

Browser Userscript Manager
Chrome / Edge / Brave Tampermonkey
Firefox Violentmonkey

Quick Install

  1. Install the manager for your browser.
  2. Click Install LeetSessionleetsession.user.js.
  3. Confirm the prompt in your userscript dashboard.
  4. Go to https://leetcode.com/problemset – the New Session button appears under Study Plan in the left bar.

Automatic Updates

The script defines an @updateURL, so your manager will fetch new versions automatically.

Usage

  • Click New Session whenever you want to start from scratch.
  • Keep the [LS] tag in the list name if you want daily auto-sync.

How It Works

  • Relies on GraphQL mutations accepted by LeetCode (createEmptyFavorite, batchAddQuestionsToFavorite, resetFavoriteSessionV2, updateFavoriteNameDescriptionV2).
  • Operates only on lists that contain [LS]; other lists are never queried or modified.
  • Stores the last sync date in localStorage and runs silently every 24 h.
  • Detects interrupted creation (closed tab, crash) and resumes on the next visit.

FAQ / Troubleshooting

How many sessions can I create? **Unlimited.** Each click creates an independent list (`#1`, `#2`, …).
Can I rename a session or edit its description? Yes. Keep the tag **`[LS]`** anywhere in the name to preserve auto-sync.
Can I remove some problems from the list? You can, but if the name still contains **`[LS]`** the script will add every missing problem back during the next sync. Your progress (solved problems) will be preserved.
Button doesn’t show up * Reload the page. * Ensure the userscript manager is **Enabled**. * Check that no content blocker removes sidebar elements.
Stuck on “⏳ Creating session…” You likely hit LeetCode’s rate limit (HTTP 429). Leave the tab open; the script retries automatically with exponential back-off.
What happens if I close the browser during creation? The script detects incomplete sessions and automatically resumes creation on the next visit. Look for sessions with `[CREATING]` in the name.
Can I use this with multiple LeetCode accounts? Yes, each account maintains its own sessions independently. The script only operates on lists containing `[LS]`.
How do I know if auto-sync is working? Check the browser console for `[LeetSession]` logs. You'll see sync messages when new problems are added.

Contributing

PRs are welcome! ⭐️

License

MIT © 2025 Valentin Chizhov

Acknowledgements

  • LeetCode team for keeping the legacy mutations alive
  • Community discussion in #22883 – inspiration for this script