Replaced Firefox-only javascript with a more broadly supported solution.