Reputation: 761
I'm making a webpage for a browser extension and I want the download button to automatically download the relevant file for the browser the user is on.
I've found that jQuery's $.browser
feature is now deprecated, so is there an easy way of detecting the user's browser?
Upvotes: 0
Views: 7491
Reputation: 8171
If you want information about the browser that your visitor uses, and use it for statistics or displaying information to the user, you can use the jQuery Browser Plugin.
you can also use - navigator.userAgent
for detect user browser.
Upvotes: 2
Reputation: 56549
Try to detect the features instead using jQuery.support
EDIT:
Then you can do it simply using navigator.userAgent
(though parsing needed)
Decrypting the User Agent String in JavaScript
Upvotes: 1
Reputation: 43
It can still be a pain with all the browser specific dependencies in old jQuery plugins.
Try using jQBrowser: http://davecardwell.co.uk/javascript/jquery/plugins/jquery-browserdetect/
Almost same syntax:
$.browser.browser();
$.browser.version.number();
Upvotes: 0