Possible to run JavaScript when TTS has finished speaking?

Hello,

I wish to run some JavaScript after the TTS of a card has finished speaking the first time. I know the AnkiDroid JavaScript API has a suitable ankiTtsIsSpeaking methodbut was wondering if desktop has something similar, either default or via an add-on. I only use the multi-field syntax- [anki:tts...] if that makes a difference.

The specific JS I want to run is:
fetch('http://localhost:8000/my_script')