See upstream bug:
I applied a simple workaround to make calling alert() not trigger the bug described in #1318. This is only a hacky workaround, and should be removed once the upstream bug is fixed.
Apply alert workaround only to broken Firefoxen.
Fix alert + setTimeout in grant none case.