Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Browsers older than two years

This is for a private company site with about 10,000 users.

I've seen a couple of efforts for browser detection but nothing with the age of the browser, does anyone have an idea for this?

Related Projects:

  • http://fresh-browsers.com/en
  • https://github.com/Groozly/Fresh-Browsers
  • http://jquery.thewikies.com/browser/

So far I was thinking client side but if there are any server side options I'm open to that as well.

not looking to scrape sites.

They are looking to upgrade browsers and currently want to drop support for browsers older than two year

like image 881
Phill Pafford Avatar asked Apr 27 '12 16:04

Phill Pafford


2 Answers

You're going about it all the wrong way. You don't support browsers, you support features. Browsers don't expire like a can of beans would in your pantry. Use feature detection and polyfills when developing - this will retroactively provide support to browsers 10 years old.

Various tools exist to help you support browsers that may be lacking in the feature department. One popular one is Modernizr. Not only does this expose an object that tells you over 40 different things about what the user agent is capable of, it also polyfills a subset of HTML5 tags, and attaches informative CSS classnames to your document that let you style against browsers that support or don't support any given feature.

Using great practices like this will ultimately result in a better experience for your clients, improved reputation for your employer, and less frustration for you having to try and figure out some magical expression for determining the antiquity of a faceless browser by some mutable user agent string.

like image 169
Sampson Avatar answered Oct 07 '22 09:10

Sampson


Firefox includes a build date in it's User Agent string, but I'm not sure if other browsers do that. I think your best bet will be to use a white list approach rather than trying to black list an unknown number of browsers. Here are a few sites that can help you warn users when their browser isn't on your white list.

  • http://code.google.com/p/ie6-upgrade-warning/
  • http://browser-update.org/
  • http://www.ajaxblender.com/browser-detection.html
  • http://www.updateyourbrowser.net/en/
  • http://www.privacychoice.org/resources/browser_upgrade
  • -
like image 33
Chris Bloom Avatar answered Oct 07 '22 07:10

Chris Bloom