This Chrome extension provides an interactive chess puzzle solving experience. It helps users improve their chess skills by presenting them with timed puzzles during their browsing sessions.
- Timed chess puzzles that appear as overlays on specified websites
- Customizable timer duration and website list
- Interactive chessboard with drag-and-drop functionality
- Puzzle difficulty levels (Easy, Medium, Hard)
- Hint system for challenging puzzles
- Settings page for customization
manifest.json
: The extension manifest filebackground/
: Contains the service worker for the extensionservice-worker.js
: Manages the background processes, including timers and messaging
images/
: Icon images for the extensionoverlay/
: Contains the overlay functionalityoverlay.js
: Manages the chess puzzle overlay display and interaction
popup/
: Contains the extension popuppopup.html
: HTML structure for the popuppopup.css
: Styles for the popuppopup.js
: JavaScript for popup functionality
scripts/
: Contains the main chess game and puzzle generator scriptschess-game.js
: Implements the chess game logicpuzzle-generator.js
: Manages puzzle generation and difficulty
settings/
: Contains the settings pagesettings.html
: HTML structure for the settings pagesettings.css
: Styles for the settings pagesettings.js
: JavaScript for settings functionality
styles/
: Contains additional styleschessboard.css
: Styles for the chessboard
The libs/
directory is not included in this repository. You need to obtain the following libraries:
- chess.js: A JavaScript chess library for chess move generation/validation, piece placement/movement, and check/checkmate/draw detection
- jquery.min.js: jQuery library for DOM manipulation
- chessboard.js (version 1.0.0): A JavaScript chessboard library
Place these files in the libs/
directory.
The Puzzles/
directory is not included in this repository. To get the puzzles:
- Download the puzzle database from Lichess: Lichess Puzzle Database
- Format the puzzles according to the Lichess puzzle format. Each puzzle should have the following structure:
{ "PuzzleId": "unique_id", "FEN": "chess_position_in_FEN_notation", "Moves": "move1 move2 move3 ...", "Rating": 1500, "Themes": "theme1 theme2 theme3" }
- Use the
puzzleutils.py
script in thePuzzles/
directory to process and prepare the puzzles for use in the extension. This script should convert the Lichess puzzle format into the format used by the extension.
- Clone this repository
- Obtain the required libraries and place them in the
libs/
directory - Prepare the puzzles and place them in the
Puzzles/
directory - Load the extension in Chrome:
- Go to
chrome://extensions/
- Enable "Developer mode"
- Click "Load unpacked"
- Select the directory containing this project
- Go to
- Click on the extension icon in Chrome to open the popup
- Use the Settings page to customize:
- Websites where puzzles will appear
- Timer duration for puzzles
- Browse the web normally. When visiting a specified website, a chess puzzle will appear after the set duration
- Solve the puzzle to continue browsing, or wait for the timer to expire
To modify or extend the extension:
- Edit the relevant files in the project structure
- For major changes, update the
manifest.json
file accordingly - Reload the extension in Chrome to see your changes
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.