1

REQUIREMENT: I want to compare user's browser version is latest one or not. So what I want is to check what browser i.e. IE, Chrome, FF or Safari and then what version of that browser is using. Then I need to check if the version user having is latest one or not. If it is not latest then I want to notify user with some custom user defined message.

WHAT I HAVE DONE: I'm able to detect user browser and version.

PROBLEM: How to check what is the latest version of that browser that user is using.

NOTE: I read this thread but I didn't find any answer.

Please let me know how to check the latest version of different browsers i.e. IE, Chrome, FF and Safari.

Thanks!!!

Community
  • 1
  • 1
Deepak Biswal
  • 4,280
  • 2
  • 20
  • 37
  • Have you a webserver? – Tinwor Oct 17 '14 at 10:39
  • I guess you have to spoof the userAgent string. Just be aware that the user can change that string as he likes. From MDN docs: https://developer.mozilla.org/en-US/docs/Browser_detection_using_the_user_agent – MarcoL Oct 17 '14 at 10:39
  • Yes, I'm using a node.js for server end codes and it's running on HTTP. – Deepak Biswal Oct 17 '14 at 10:41
  • Quentin: I didn't find my answer there. And that's the reason I have added the new question. Also in my question I have added that in NOTE section. Some answer links are showing 404 on the [thread](http://stackoverflow.com/questions/720826/how-to-check-if-a-visitor-is-using-the-latest-version-of-his-her-browser) – Deepak Biswal Oct 17 '14 at 11:01
  • 1
    I agree with the duplicate target being a not useful, but duplicates are defined be the question, not the quality of the answers. – bummi Oct 17 '14 at 11:26
  • [Detect version of browser](http://stackoverflow.com/questions/5916900/detect-version-of-browser) – bummi Oct 17 '14 at 11:59
  • @DeepakBiswal — If you want to encourage better answers for an existing question, put a bounty on it instead of duplicating it. – Quentin Oct 17 '14 at 12:02

1 Answers1

-1

Edited answer as incorrectly answered due to not reading the question well enough.

You can get the latest browser version in JSON, XML using a service such as http://fresh-browsers.com.

Then using navigator.userAgent you should be able to check the browser version.

roughcoder
  • 1,190
  • 1
  • 8
  • 11
  • That's quite out of date. And link-only answers are off-topic for stackoverflow anyway. – Quentin Oct 17 '14 at 10:40
  • true, moved code into answer – roughcoder Oct 17 '14 at 10:41
  • That doesn't do version detection for any browser other than IE, so how can it tell if the latest version is installed? And it doesn't support IE 11. – Quentin Oct 17 '14 at 10:43
  • The IE 11 user agent string is `Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko ` so `var ie11 = /MSIE 11.0/.test( navigator.userAgent );` will not match it. – Quentin Oct 17 '14 at 10:55
  • Edited my answer, it was poor - ideally should be a comment to the above answer, can a answer be changed to a comment with a click of a button? – roughcoder Oct 17 '14 at 13:17