2

My application includes a browser extension. I want to provide a single "install" button that references the correct extension, based on the browser the user is using.

What are the pros and cons of server-side versus client-side browser detection?

Remember, this is for actual browser detection and not capability detection, which I would handle completely differently. ;)

2
  • How many versions of the extension are there? Which browsers do you want to differentiate? Commented Dec 9, 2011 at 2:12
  • Eventually we want to cover all browsers. Right now, we have Firefox and Chrome. IE and Safari will be next (unfortunately, IE might require different extensions). There is a small chance we might do an Opera extension as well. Commented Dec 9, 2011 at 18:28

1 Answer 1

5

Normally you want to detect the browser in the client but you could just as well detect it at the server. Just know that the user agent string can be faked so you can't depend on it. The only sure fire way is to have the user choose the browser but you could use browser detection to suggest.

Here is the client side browser detecting I use and if you really want to here is the server side equivalent. Like I said before there isn't too much difference because they both just look at the user agent string but one thing I did think of is if you do it server side, then you can send down only the link for the browser you think they have where as with the client side version they could view the source and see the links for each browser's extension... not a big deal really but one possible difference.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.