main.js redirect broken

This is necessary for firefox and chromium. IE untested.