Refactors firefox js usage into a mixin.
Land #3296 - Refactors firefox js usage into a mixin