Skip to content

Testing Text-to-Audio with Firefox's Experimental Web Extensions API

Posted on:April 11, 2025

I made a simple Firefox extension that leverages cutting-edge machine learning to transform any selected text on a webpage into natural-sounding speech, all while running entirely in your browser. Unlike some text-to-speech solutions that send your data to remote servers, this extension processes everything locally using Firefox’s trial ML capabilities and transformers.js.

With a simple right-click on any selected text, the extension synthesizes human-like speech with pretty good intonation and natural flow for the most part. What makes this approach groundbreaking is that it combines privacy (your text never leaves your device) with the superior quality of neural TTS models. I’ve been watching these models get better and better.

You can read up on the documentation here: https://firefox-source-docs.mozilla.org/toolkit/components/ml/

I hardly wrote any of the code but helped debug with Github’s Copilot. For anyone who wants to take a look at the slop, check it out here: https://github.com/matthewbcool/firefox-tts-extension

The extension demonstrates how modern browsers are evolving into powerful ML platforms capable of running sophisticated AI models locally. This means high-quality, privacy-preserving text-to-speech is now accessible to anyone without specialized hardware or cloud dependencies.

So its just a test but I’m glad to see it working and hope to see other devs play with this technology more.

[Note: The extension uses Firefox’s experimental trialML API, which allows running ONNX models directly in the browser, converting text to speech through a sophisticated transformer-based neural network architecture I don’t understand at all.]