mozilla/fireplace — pull request #398 by cvan (2014-03-15 00:31:47+00:00)
Title: defer loading of persona include.js (bug 983556)

1. When the page first loads, and if the user was not already signed in, we set `cursor: wait` for the "Sign in" link so it's clear that the user is in some holding pattern. (I haven't been able to see this, even on my crappy Comcast connection, unless I'm proxying Persona through a delayer.)
2. We check if Persona has been loaded every 25 milliseconds (simple `'id' in navigator` check).

a. If Persona loads within the 30 seconds, we resolve the deferred and let the user sign in (i.e., we call `navigator.id.watch`).
b. If Persona times out after 30 seconds, we reject the deferred and pop up a notification telling the user that Persona is responsive.

Feel free to test this locally with [http://deelay.me/5000/http://login.persona.org/include.js](http://deelay.me/5000/http://login.persona.org/include.js) to simulate a slow Persona load.