Chess.com_Analysis_Chrome_extension icon indicating copy to clipboard operation
Chess.com_Analysis_Chrome_extension copied to clipboard

Inject Game Review button on chess.com

Open makaroni4 opened this issue 1 year ago • 2 comments

Original issue: https://github.com/ZeroSharp/Chess.com_Analysis_Chrome_extension/issues/14

It's a sample PR that adds a Lichess Game Review button on chess.com.

Since chess.com is a Vue app, we need to listen to DOM Mutations to inject the review button properly. PR adds a Lichess icon and correspondent manifest changes.

The review button triggers PGN copy via the sendMessage mechanism (same as the extension icon), that's why the handling logic is extracted into a function.

Here's how it looks like for small screens:

Screenshot 2024-08-14 at 22 07 26

And big screens:

Screenshot 2024-08-14 at 22 07 34

Happy to get any feedback, in the meantime anyone can use this version manually:

  1. Download the forked repo https://github.com/makaroni4/Chess.com_Analysis_Chrome_extension
  2. Go to chrome://extensions/
  3. Click "Load unpacked" and select the ext folder from a downloaded repo.
  4. 🍻

makaroni4 avatar Aug 14 '24 20:08 makaroni4

This is amazing @makaroni4. Thanks so much! Sorry it's taken a while to look at your changes. I was in Iceland on holiday but I'll try to find some time this week to review and merge.

shamp00 avatar Sep 10 '24 19:09 shamp00

Hey @shamp00 :wave:

The PR is just a PoC that injects the button on one game review page (only with people, not with bots, for example).

Wdyt about adding the fixed position button (in the bottom of the screen, for example) vs injecting a button in the sidebar menu? Let's align on this and I'll add this to all pages. Thank you for this extension, I use it every time I play chess now 🙌

makaroni4 avatar Sep 10 '24 20:09 makaroni4