sync main.js with firefox changes