Closed himittal09 closed 3 years ago
Hi @himittal09 Intercepting requests for free problems can be done but it is going to take time to implement. Not sure If It will be implemented in the next release yet as the following things will take time
https://leetcode.com/problemset/all/
and https://leetcode.com/tag/dynamic-programming/
pagelocked problems
checkbox temporarily and give a poor user experience (because an additional reload will be required along with unchecking locked problems
checkbox to see the premium problems)Thanks for the research work
Instead of hiding the elements from the DOM with a CSS class, the request's response can be intercepted before it reaches to the leetcode client, and then we can delete entries for question which are premium only.
Leetcode API request URL to backend: "https://leetcode.com/api/problems/algorithms/"
Example Response:
"stat_status_pairs": [ { "stat": { "question_id": 2062, "question__article__live": null, "question__article__slug": null, "question__article__has_video_solution": null, "question__title": "Game of Nim", "question__title_slug": "game-of-nim", "question__hide": false, "total_acs": 94, "total_submitted": 145, "frontend_question_id": 1908, "is_new_question": true }, "status": null, "difficulty": { "level": 2 }, "paid_only": true, "is_favor": false, "frequency": 0, "progress": 0 } ]
We need to iterate the stat_status_pairs array to filter the questions which has paid_only turned to false.
I don't know how to intercept http requests though Edit: little search landed me here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest#modifying_responses