views:

102

answers:

3

Hi ,

I have a website,which is "currently" designed & tested to work only on firefox.If user tries to open it in other browser then I want to show a popup saying "This site works best with Mozilla Firefox. We're working hard to add support for your favorite browser. Meanwhile, do try it with Firefox."

Can we provide a buttion on clicking of which, one new window will be opened in firefox preloaded with some URL ? and also tells us in case firefox is not available at its default location ?

Thanks, Sourabh

+3  A: 

You can't test for Firefox being available nor start it using JavaScript. That would create big security holes...

You can try to figure out if the current browser is Firefox and output a message, although I really hate them (remember that not every visitor will be able to install/use another browser, e.g. within companies or public places).

Marcel Korpel
A: 

If it only works on one browser, it isn't a website.

Joe R
True, but not an *answer*. This is a comment.
T.J. Crowder
@T.J. Crowder. My answer is that there isn't an adequate solution to this problem, so try to change your work and make it a website...
Joe R
@Joe R: I'm not seeing this as useful, or an answer, at all -- but apparently at least four people do. I mean, the guy actually says he *is* "...working hard to add support for your favorite browser." So what use is this? Marcel Korpel actually answered *the question* : Can you run Firefox? No, but here's what you *can* do. (Not my downvote, btw)
T.J. Crowder
@T.J. Crowder - sometimes we have to rush our work and compromise, but there is a cut-off point where more time is the only sensible option. I do see your point, but in my view this is one of those situations where more time is required. My answer is don't even try. I could elaborate on why you shouldn't try... Perhaps my brevity sounds too confrontational, that isn’t what I want.
Joe R
+5  A: 

If you make your website standard-conformant, chances are pretty high it will work in Firefox, Opera and WebKit-based browsers (Safari, Chrome), without having to use much browser-specific code. Problem is, as usual, with IE. To achieve best results, write a website for standard-compliant browsers, then add hacks to make it work in IE.

You cannot detect installed applications on client computer, nor launch any of them - beacuse of security. All you can do is to do browser sniffing. You can do it on server side (by examining User-Agent header), or on client side (using JavaScript to check window.navigator object). It is quite complicated and error-prone though and certainly not forward-compatible (future browser versions may confuse your scripts). Moreover, users can change their browser's identification. When you detect unsupported browser, you could display some popup asking user to switch browser.

If you want to detect only IE, you can use IE's conditional comments, which is a most reliable way for detecting IE.

el.pescado