Firefox 24 compatibility

Includes workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=881237
(although Standalone now needs a workaround for the workaround)