um this sounds like a cheat tbh
When coding a chrome extension, how can i listen to the event when either player makes a move?

MutationObserver
However, for some reason, this sometimes breaks, especially when you leave the site and come back. When I've tried experimenting, the best way I have found is to just check whether the player nametag has changed every few seconds.

it's not a cheat
what is it
I mean I made an extension which automatically provides you with stats related to your opponent and displays them next to the game, so not everything is gonna be a cheat. Additionally, if this guy asks simple questions in this forum, he's likely incapable of coding a cheat chess bot himself, of which many free and open source versions already exist, so I don't see the point of.
MutationObserver
However, for some reason, this sometimes breaks, especially when you leave the site and come back. When I've tried experimenting, the best way I have found is to just check whether the player nametag has changed every few seconds.
from what i understand, the fact that the board is generated dynamically rather than being there from the moment the page is loaded might be the source of the problem, no?

MutationObserver
However, for some reason, this sometimes breaks, especially when you leave the site and come back. When I've tried experimenting, the best way I have found is to just check whether the player nametag has changed every few seconds.
from what i understand, the fact that the board is generated dynamically rather than being there from the moment the page is loaded might be the source of the problem, no?
Normally when you first load a new game, it detects your opponents username, but after subsequent new games, mutation observer no longer detects changes for some reason in the testing I have done.

could you please explain what did you mean by checking if the player nametag changed?
Where it says your opponents name.

So, on my content.js file i'm currently able to do what i want, but i want this function to be called again everytime a player makes a move. How can i achieve that?
For move detection (by polling) take a look at this: https://github.com/Hyper-Dragon/DgtAngel/tree/main/sourceExt/DgtAngelCdcPlay
So, on my content.js file i'm currently able to do what i want, but i want this function to be called again everytime a player makes a move. How can i achieve that?