How goldmangrey/chess.com-cheat works
Chess Practice Overlay is a Chrome extension that turns Chess.com board state into local Stockfish hints and displays them over the board. Its main workflow detects the game and board, parses pieces into position snapshots, validates reachable moves with chess.js, requests engine analysis through the extension’s background/offscreen path, then renders the best move as an SVG overlay. The popup controls hint visibility and engine depth. README documents the overall pipeline; sampled source confirms key construction and messaging relationships. The content excerpt contains a commented-out mode gate, so the graph does not imply that gate currently blocks unsupported modes.
Main entry points: index.ts Content session · analysis-controller.ts Analysis controller · board-overlay.ts Board overlay · App.tsx Settings popup
Components 21
Chess.com Position Capture
- Board detector
src/platform/chesscom/board-detector.ts - Game mode
src/platform/chesscom/game-mode.ts - Piece parser
src/platform/chesscom/piece-parser.ts - FEN builder
src/platform/chesscom/fen-builder.ts - Position observer
src/platform/chesscom/position-observer.ts - Board orientation
src/platform/chesscom/orientation.ts - Player color
src/platform/chesscom/player-color.ts
Chess Analysis
- Legal move state
src/shared/chess-state.ts - Analysis controller
src/engine/analysis-controller.ts - Engine client
src/engine/stockfish-client.ts - Stockfish worker
public/engine/stockfish-18-lite-single.js
Overlay Presentation
- Board overlay
src/overlay/board-overlay.ts - Arrow rendering
src/overlay/arrows.ts - Board coordinates
src/overlay/coordinates.ts
Extension Runtime
- Content session
src/content/index.ts - Service worker
src/background/service-worker.ts - Offscreen engine host
src/offscreen/index.ts - Settings popup
src/popup/App.tsx
Other components
- Chess.com board
- Extension user
- Chrome local storage
Connections 24
- Chess.com board → Board detector: provides DOM
README.md - Content session → Board detector: detects board
src/content/index.ts - Content session → Game mode: detects mode
src/content/index.ts - Content session → Board orientation: checks orientation
src/content/index.ts - Content session → Player color: detects color
src/content/index.ts - Position observer → Piece parser: parses pieces
- Position observer → FEN builder: builds snapshots
src/platform/chesscom/position-observer.ts - FEN builder → Piece parser: parses pieces
src/platform/chesscom/fen-builder.ts - Content session → Position observer: tracks position
README.md - Content session → FEN builder: creates snapshots
src/content/index.ts - Content session → Legal move state: validates moves
src/content/index.ts - Content session → Analysis controller: starts analysis
src/content/index.ts - Analysis controller → Engine client: requests analysis
src/engine/analysis-controller.ts - Analysis controller → Board overlay: draws result
src/engine/analysis-controller.ts - Engine client → Service worker: sends requests
src/engine/stockfish-client.ts - Service worker → Offscreen engine host: forwards engine work
README.md - Offscreen engine host → Stockfish worker: runs worker
src/offscreen/index.ts - Board overlay → Arrow rendering: renders hints
src/overlay/board-overlay.ts - Arrow rendering → Board coordinates: maps squares
src/overlay/arrows.ts - Board overlay → Chess.com board: overlays board
README.md - Extension user → Settings popup: changes settings
src/popup/App.tsx - Settings popup → Chrome local storage: reads and writes
src/popup/App.tsx - Settings popup → Content session: sends settings
src/popup/App.tsx - Content session → Chrome local storage: loads settings
src/content/index.ts