Modify behavior of web channel

I’m trying to modify the behavior of the web channel frontend. Specifically, I’d like add the behavior that when a new response is received from the server, the frontend uses the javascript window.SpeechSynthesis API to say the received message out loud. This should occur around the same time that the new message is displayed on screen.

I’m having trouble figuring out where to start. I’ve been digging around through the installation folder on my server as well as through the source code in Github and I can’t seem to figure out where the javascript code is that defines the web channel frontend. Any pointers?