JavaScript: Firefox/Aurora 6 and EventSource API

I originally wrote this as a comment on Mozilla’s “Aurora 6 Is Here” article – but I’m impatient and couldn’t wait for the comment to be moderated. Also, I haven’t posted in a while and figured Bob the Rooster would appreciate it.

Glad to see support for the EventSource API has made it to Firefox.

There is a major flaw in all existing implementations in that they do not actually open a “listener” for some sort of event that is generated and sent from the server. What has actually been implemented is the equivalent to a native polling mechanism, which is useful none-the-less.

Last fall I released a test supported (unit and spec tests) jQuery extension that provides a unified API (using XHR as fallback).

Additionally, I’ve created these useful EventSource API tests, snippets and demos:

Serializing Array to JSON data:

Echo serialized GET params:

Sending GET params:

I have a number of other gists:

A quickstart guide to EventSource:

An article I wrote about creating EventSource from WebWorker threads:

A mini-web-chat written with EventSource: &

Now that Firefox, Chrome and Opera have implemented the EventSource API, I think it’s a safe and viable addition to our development tool kits.


Contact Us

We'd love to hear from you. Get in touch!


+1 617-379-2752


P.O. Box 961436
Boston, MA 02196