A browser extension and lightweight Rust background helper that shares current Amazon Music playback status to Discord Rich Presence.
I created a browser extension and native messaging companion in Rust that displays active Amazon Music tracks in Discord status. The browser extension reads track details directly from the standard browser Media Session API and internal player state rather than fragile web page scraping. The Rust background process communicates with the browser using native messaging and sends status updates over Discord IPC, incorporating update batching and rate limiting to keep Discord presence smooth and responsive.
Discord provides built-in Rich Presence integration for Spotify, but users of other streaming platforms like Amazon Music lack an official way to share their currently playing music with friends. Many third-party solutions attempt to read song titles by scraping HTML elements directly from the web player, which frequently breaks whenever the streaming service updates its website layout or CSS classes. I built this extension to extract song titles, artists, album artwork, and playback progress cleanly by hooking into the browser's standard Media Session API and internal player events.
Because web extensions cannot open local operating system sockets directly, the browser component pairs with a lightweight native helper program written in Rust. This separation keeps the extension secure while allowing status updates to reach the local Discord desktop client through standard inter-process communication.
The browser extension sends track updates to the companion application using the native messaging protocols supported by Chromium and Firefox. The Rust background application connects to Discord's local IPC pipe, parses incoming playback packets, and manages connection recovery if Discord is closed and reopened during playback.
To avoid triggering Discord's network rate limits or causing the status widget to flicker on every elapsed second of audio, the Rust helper batches incoming progress updates and enforces a maximum rate of five updates per twenty seconds. This architecture results in a fast, low-memory utility that runs quietly in the background without requiring heavy frameworks or separate desktop interface windows.