Never miss the agent in the Jetstar chat
A console script that makes the Jetstar live chat beep, and keep beeping, when an agent writes, so you do not lose your place in the queue.

- Runs on
- Browser console
- Needs
- A desktop browser. Tested in Google Chrome.
- Licence
- MIT
What it does
- Paste it into the DevTools Console on the Jetstar page, and a small panel appears at the bottom left
- A three-tone alert when a new agent or bot message arrives
- While you look at another window or tab, the alert repeats every 3 s and the tab title flashes, until you come back, click the panel or mute it
- Test sound also tests the repeat: click it, switch to another window within 10 s, and it keeps ringing
- Ignores your own messages, typing indicators and page changes outside the chat
- The chat redraws its whole history on each update, so it compares the text with the last check and only really new lines make a sound
- Copy chat copies the chat text and a timed log of every message, a record for your claim
- Self test reports PASS or FAIL for each check, with a Copy button
- Reads the page in your own browser only and sends nothing anywhere; a reload removes it
My flight was cancelled, and the claim had to go through the Jetstar live chat. You wait in a queue for a long time. You look at another window. The agent joins, asks once, gets no answer and closes the chat. You start again at the back of the queue.
The chat plays no sound. So I built the sound while I waited. When the first version worked, I asked for one more thing: keep ringing until I look at the screen again.
It is a script you paste into the browser console. It reads the page in your own browser and sends nothing anywhere. The claim went through.
I did not write it. I prompted it, the same way everything on this show gets made. It is open source and free, and it is not affiliated with Jetstar.
The prompt
All my requests, merged into one. I pasted the page source of the chat window under it.
I have to make a Jetstar complaint in their live chat, but I get no sound when a new message arrives. Create a script that I can paste into the browser console. It must: 1. Play a sound when a new chat message arrives. Ignore my own messages and the "typing" indicator. 2. Have a Test sound button, so I can check that I hear it. 3. Keep playing the sound until I come back to the page. Test it like this: I click Test sound, switch to another window, and the alarm repeats. 4. Have a Copy chat button, so I can paste the whole chat back to you and you help me with my case. 5. Have a Self test button with a detailed PASS/FAIL report that you can use to fix the script. Here is the page source of the chat window. This is an open source project.
What I gave back to Claude
- The page source. Claude found the chat widget in it, a Cognigy webchat.
- The self test report. Claude read the PASS and FAIL lines and fixed the script without seeing my screen.
- The chat itself, from Copy chat. Claude drafted each reply to the agent. The same text showed a bug: the chat redraws its whole history on every update, so old messages beeped again. That got fixed too.
How it is tested
npm test opens fake chat pages in a headless Chrome and counts the beeps. An agent message
beeps; my own message and “typing” do not. The alarm repeats while I am away and stops when I
come back. A second test replays the history redraw, and runs the old version beside the new one
to prove the test can see the bug.