I'm writing userscripts to interact with Stack Exchange chatChat. I'd like to be notified when things happen (e.g. messages added, removed, edited, users joining, etc.). I know that I could use a MutationObserver
to watch for changes to the DOM, but is there any way to register a callback with the SE chatChat system to be notified upon these events happening?