A Chrome and Firefox extension that calculates a player's number of losses in the past day on chess.com. If this is greater than the maxGames number input by the user, the chess.com/play/online page is blocked.
https://chrome.google.com/webstore/detail/chesscom-blocker/pacoipifgdogfclpkfmjomngfleabgfn/
https://addons.mozilla.org/en-US/firefox/addon/chess-com-blocker/
Chrome
-
Download the repository as a ZIP file and extract it to a folder on your computer.
-
Open Chrome and go to
chrome://extensions
. -
Enable "Developer mode" by clicking on the toggle switch in the top right corner.
-
Click on "Load unpacked" and select the extracted folder.
Firefox
-
Download the Firefox repository as a ZIP file and extract it to a folder on your computer.
-
Open Firefox and go to
about:debugging
. -
Click on "This Firefox" and then on "Load Temporary Add-on".
-
Select the
manifest.json
file from the extracted folder.
Click the extension. Input your username and the max number of games you wish to play. Once you exceed the number of games played, the chess.com/play/online page will be blocked.
It is blocked until you no longer have have X losses in the last 24 hours.
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
I use the knook image obtained from reddit.com/r/anarchychess/wiki
To get the number of losses, I:
- Get the user's games from the past day with the chess.com API
- Count the number of losses
This loss check is triggered after a game ends,
If the number of losses is above the maxGames, some html is injected into the page instead of the normal content.
There is also the case where your game ends but the chess.com api hasn't updated yet. I handle it by using a mutation observer on .player-component.player-bottom
. I look for the player game over component, and specifically parse the .rating-score-change
class. If current # of losses
+ 1 > maxGames
then the user is blocked immediately, and I don't have to wait for the chess.com API to update.
This project uses the GPL3 License (LICENSE.md).