# LeetCodeRating: a userscript that shows contest difficulty on LeetCode

> LeetCodeRating is a Tampermonkey userscript that overlays the weekly contest difficulty rating on LeetCode problem, tag and problemset pages, with a separate English branch that covers less. It is aimed at LeetCode users who want to know how hard a problem was when it appeared in a contest.

**zhang-wangz/LeetCodeRating** — 一款对应力扣的浏览器油猴插件| TamperMonkey | Chrome

- Repository: https://github.com/zhang-wangz/LeetCodeRating
- Website: https://lc.slowme.cn/
- Stars: 1,275 · Forks: 40
- Language: JavaScript
- License: NOASSERTION
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/zhang-wangz-leetcoderating

## A userscript, not an extension or a web app

LeetCodeRating is a browser userscript that shows the weekly contest difficulty score for a problem on LeetCode. The README describes it as a browser plugin for the corresponding LeetCode site, and the project description calls it a Tampermonkey script for Chrome.

The mechanism is the important part. The distributable artifact is `leetcodeRating_greasyfork.user.js` at the top level of the repository, a single script file that a script manager injects into matching pages. The README is explicit that before using it you need to install a script manager plugin in your browser, and it names Tampermonkey (the new version of the popular Chinese script manager) as the supported choice.

Nothing is compiled and nothing is deployed to a server of your own. The script runs in your browser, in the context of the LeetCode page, and reads the page to place the rating where you want to see it. That has a clear consequence: the value is tied to the site, and the script has to keep working as LeetCode changes its markup. A userscript that depends on the DOM structure of a site you do not control is inherently fragile in a way that a server side library is not.

The homepage of the project is lc.slowme.cn, which the README links as the documentation, and there is a separate documentation page at lc.slowme.cn/Usage.html for version notes and feature descriptions.

## Installation is a click in a script catalogue

There is no build step for the userscript itself. The README lists two distribution routes, and the reason for two is geographical rather than technical.

One route is ScriptCat, offered as the option for people without access to a proxy. The other is GreasyFork, which the README notes is blocked by the Great Firewall in China and therefore requires a proxy to reach. Both are standard script manager catalogues, and installing from either puts the script into Tampermonkey, which then applies it to the pages it matches.

Browser support is stated narrowly: Chrome or Edge, with Edge marked as the recommended option. Operating system support is broader, covering Windows, macOS and Linux and any other system running a supported browser, with mobile platforms such as iOS and Android explicitly excluded.

The README also notes that both the Chinese and English LeetCode sites are supported by the Chinese version. The English build lives on a separate branch rather than being a setting, which is a decision worth understanding before you install anything, because the two branches are not the same product.

## The english branch is a narrower product

Switching to the English site means switching the GitHub branch to `english`, and the README warns about what you get. The English version only shows the difficulty rating on the problemset page, the tag page and the question page, and does not support the other functions the Chinese site build provides.

That is a real functional gap rather than a translation difference. The Chinese version carries a larger feature set, and the English branch reduces it to the three page types where the rating can be displayed.

The maintenance arrangement is also unusual and worth noting. The README states that the English version has been maintained since 2024 by a different contributor, and it asks for maintainers for the English side. The text also contains an older line saying the English version would be temporarily suspended from 2023 and that suitable maintainers were being recruited, which appears to be an outdated note that was never removed from the README.

So the practical reading is that the two branches are maintained separately, by different people, with different feature coverage, and the documentation describing them is not fully in sync.

## The documentation site is built with idoc

The repository carries more than the userscript. There is a `docs/` directory, an `idoc.yml` configuration file, an `assets/` directory, an `images/` directory, and a `package.json` whose scripts are all documentation tooling:

```json
"scripts": {
    "start": "idoc -w",
    "build": "idoc",
    "deploy": "gh-pages -d dist"
  }
```

The `start` script runs idoc in watch mode, `build` produces the site, and `deploy` publishes the `dist` folder to gh-pages. The devDependencies are consistent with that: idoc for the documentation generator, gh-pages for publishing, and prettier for formatting, with a `prettier.config.js` and a `.prettierignore` in the repository.

The source directories hint at what else lives here. There is a `stormlevel/` directory and a `tencentdoc/` directory alongside `leetcoderatingjs/`, which is where the JavaScript for the script itself is kept. The documentation site is therefore maintained in the same repository as the script, which is convenient for contributors, and it is why the README can point at lc.slowme.cn as the place to read about usage.

The npm package metadata here describes the documentation site rather than the userscript: the name is LeetCodeRating, the description field reads as a usage note, and the version field is 0.0.1. That version has nothing to do with the userscript version, which is tracked separately.

## Releasing the script is a manual three file chore

The README documents its own release process in unusual detail, which tells you what a change to this project actually involves.

The version number is kept in three places that must agree. The `@version` line at the top of the JavaScript file, the value of the variable named `version` inside that file, and the `version.json` file that records the updated version and the description of the changes. The `updatelog.txt` file also has to be updated, with the new description added as a line at the top and the version number changed there too.

The numbering rule is spelled out: increment the third part of the version if it is below 9, and if it is 9 then increment the second part and reset the third to 0, so 1.1.9 becomes 1.2.0 and 1.1.3 becomes 1.1.4. A large enough change is treated as a minor version bump, with 1.2.4 becoming 1.3.0. A note records that the rule was last adjusted on 2025-06-10, when the maximum minor version number was set to 9.

The released artifacts are named after their version, with tags such as leetcoderating_3.1.2_cn from 2026-05-14 and leetcoderating_3.0.5_cn from 2025-06-13. The `_cn` suffix is the giveaway that each release belongs to one language branch, so the two branches really are released independently.

The repository also carries a Contributor Covenant code of conduct and points contributors at an issue template and a pull request process.

## The licence metadata disagrees with package.json

Two licence statements sit in this repository and they do not match.

The repository licence field is classified as a custom licence that GitHub cannot classify, with a pointer to the LICENSE file as the authoritative text. The package.json in the same repository declares `"license": "MIT"`. Those are different claims, and the README itself only links to the LICENSE file rather than restating the terms.

For a userscript this matters less than it would for a library, since you are not redistributing it as part of a product. It still matters for anyone who reads the npm metadata instead of the LICENSE file, and for the translation work, where the script source is copied into a new branch.

Beyond the licence, the repository is organised around community contribution. The README explains how to open an issue or submit a pull request, and lists a QQ group number for the project, plus a link to the documentation site for details of what each version changed.

One last detail about the state of the project. The last push was on 2026-10-12, the newest tagged release is 3.1.2-cn from 2026-05-14, and the release before it is 3.0.5-cn from 2025-06-13. The gap between the last release and the last commit is a few months, and the release tags stop in May 2026 while commits continue after that, which is a pattern you should factor into how much you trust a given tag.

## What the script cannot do for you

It is worth being explicit about the boundaries, because the appeal of a small userscript can obscure them.

There is no local development mode and no test suite in the repository layout. The top level entries are documentation and asset directories, the script sources under `leetcoderatingjs/`, the packaged user script, an `updatelog.txt`, a `version.json` and an `update_star_history_img_url.py` helper for the badge image. Nothing resembling a test harness is listed, so a change is verified by loading it and looking at a page.

There is also no data access. The rating is shown in the page, which means you cannot query it from a script, store it in your own progress tracker, or analyse which contest problems you have solved. If you want the ratings as data, this project does not provide that, and the English branch narrows the page coverage further.

Finally, the dependency on LeetCode's own markup is the structural risk. A site redesign can break the injection logic, and when that happens the fix depends on the maintainers noticing and shipping a new version. That is the trade you accept for a script that adds one piece of information to a page you already have open, and for many users it is a good one.

## Conclusion

Adopt LeetCodeRating if you solve LeetCode problems inside a browser and want the weekly contest difficulty rating next to the problem list, and you are willing to run a userscript that injects itself into the site. Skip it if you need the rating in a local editor, in CI, or as data, since the whole mechanism is a page script. Verify first which branch you want, because the English branch only covers the problemset, tag and question pages, and read the LICENSE file yourself, because the repository licence field says it is a custom licence while package.json declares MIT. The last push was on 2026-10-12.

## FAQ

### How do I install the LeetCodeRating browser script?

You need a script manager first, and the README names Tampermonkey as the supported one, with Chrome or Edge as the recommended browsers. The script itself is installed from the ScriptCat catalogue, or from GreasyFork, which the README notes is blocked in China and needs a proxy.

### What does the LeetCodeRating script show on LeetCode?

It shows the difficulty rating a problem had in the weekly contest, next to the problem list. On the Chinese site build the rating appears on the problemset page, the tag page and the question page.

### How do I get the English version of LeetCodeRating?

You switch the GitHub branch to `english`. The README warns that the English version only shows the rating on the problemset, tag and question pages and does not support the other functions of the Chinese site build, and that it has been maintained by a different contributor since 2024.

### How is the LeetCodeRating documentation site built?

The package.json scripts drive the idoc documentation generator. The `start` script runs `idoc -w` for watch mode, `build` runs `idoc`, and `deploy` publishes the `dist` folder with gh-pages. The devDependencies are idoc, gh-pages and prettier.

### What licence does LeetCodeRating use?

The repository licence field says it is a custom licence that GitHub cannot classify and points to the LICENSE file, while the package.json declares MIT. The two statements differ, so the LICENSE file is the one to read.

## Sources

- [Issues](https://github.com/zhang-wangz/LeetCodeRating/issues)
- [Project website](https://lc.slowme.cn/)
- [README](https://github.com/zhang-wangz/LeetCodeRating/blob/main/README.md)
- [Releases](https://github.com/zhang-wangz/LeetCodeRating/releases)
- [zhang-wangz/LeetCodeRating on GitHub](https://github.com/zhang-wangz/LeetCodeRating)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/zhang-wangz-leetcoderating
