Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 1.77 KB

DOM-MAINTENANCE.md

File metadata and controls

28 lines (22 loc) · 1.77 KB

Chess.com DOM maintenance guide

KnightSense observes the visible Chess.com board through content.js and helpers.js. A Chess.com markup change may affect board discovery, piece mapping, orientation, active color, or overlay placement.

Main maintenance points

Area Source location What to inspect
Board discovery findChessComBoardElement() Board host selectors and custom elements
Shadow DOM traversal findPiecesAndContext() shadowRoot paths and nested board hosts
Piece discovery getPiecesFromContext() .piece, square-*, and data attributes
Piece mapping Helpers.mapPieceToChar() White/black piece class names
Active color Helpers.determineActiveColor() Clock turn classes and highlighted squares
FEN generation getChessComFen() Square numbering, orientation, and side to move
Overlay host createOverlay() and draw helpers Board size, stacking context, and SVG coordinates

Safe update workflow

  1. Open a Chess.com analysis board with Developer Tools.
  2. Identify the board host, piece nodes, square coordinates, orientation marker, and turn indicator.
  3. Change only the smallest selector or mapping needed.
  4. Run the JavaScript syntax checks in the root README.
  5. Reload the extension from chrome://extensions.
  6. Refresh the Chess.com tab and test a static position first.
  7. Verify White, Black, flipped-board, captured-piece, and game-navigation states.
  8. Confirm arrows remain inside the board and that disabling the engine clears overlays.

Do not add credential collection, remote telemetry, automatic move execution, stealth behavior, or fair-play bypass logic while maintaining selectors. The intended behavior is visible, user-controlled analysis for learning and permitted review.