A web extension that displays solved count for each difficulty of any tag in leetcode.com
Why leetcode-ac-count?
- Oftentimes when we are solving problems topic-wise, we want to know how many problems we have solved for each difficulty type(Easy, Medium and Hard). This is where leetcode-ac-count comes to help. It hides the default You have solved x/y problems. line and displays three lines showing how many unlocked, locked and total number of problems we have solved under the current topic(tag) we are in.
- This information helps us not to get stuck on any single difficulty level and reminds us to move on to the next difficulty level once we have solved a certain amount of problems in the current difficulty level we are solving.
- As of now the extension is only available in the Firefox Browser Add Ons. But, the extension is built to support both Mozilla Firefox and Google Chrome.
- For installing on Google Chrome, refer the below section
- Go to a location where you wish to save this repository
cd preferred_directory
- Clone the repository
git clone git@github.com:muhesh-kumar/leetcode-ac-count.git
(or)
git clone https://github.com/muhesh-kumar/leetcode-ac-count.git
- On the search bar, enter chrome://extensions/
- Click on Load Unpacked
- Go to preferred_directory
- Click on Select Folder
- Enable the extension
- On the search bar, enter about:debugging#/runtime/this-firefox
- Click on Load Temporary Add-on..
- Go to preferred_directory
- Click on any file inside preferred_directory
- Click on Open
- Click on any problem tag in leetcode.com/problemset/all
- After the tag's page(for example: leetcode.com/tag/stack) loads, the solved count status will be displayed within 10 seconds.
NOTE: Updates will be visible only after refreshing the page. The extension works on both of the old and new UI of LeetCode.
- As of now, the maximum wait time of the extension to display the solved count stats is 10 seconds. However, if you have a slow network connection or the page load itself took more than 10 seconds to load, the extension won't display the solved count stats. In that case, refresh the page again and wait for the extension to load(fixes for such issues might be made in the future)
-
Error: "This extension includes the key file ./node_modules/public-encrypt/test/test_key.pem. You probably don't want to do that."
- Removed node_modules/public-encrypt directory
-
The script gets injected before page loads completely, hence raising the error: cannot set properties of undefined
- Wrapped the whole logic inside a setTimeout() function with 5 seconds as the waiting time
- Right now it solves the problem but what happens if the page itself taks more than 10 seconds to load?
- Is there a way to make this happen instantly after the page loads?
-
Couldn't register as a chrome web store developer as there were some issues with the payment of one time registration fee
- So, published it as a firefox add on
- Operating System: Windows 11, WSL 1
- node: v16.14.0
- npm: 6.13.7
rm package-lock.json && npm i # if the next line doesn't work, run this line and again run the following lines
npm install # to install dev dependencies
npm run start # to bundle the source files into bundle.js