Forum Moderators: open
The page has to download in order to execute the JS so your conditional action has to follow on from the download. You also have to allow for visitors to have JS switched off.
There are several possibilities for addressing this but as janharders posted the easiest is a redirect.
There are bound to be ways to handle PHP pages conditionally but my only PHP experience is "monkey see - monkey do" with pre-written scripts so I can't advise with that.
Despite my personal preference for Firefox I am puzzled as to why you should want to block the world's most widely used browser.