Here we recommend a jQuery plug-in useragent for browser sniffing, which is compatible with various browsers and is often used in projects. It is a very practical and comprehensive overview.
In version 1.7.x, jQuery removes support for browser sniffing. We recommend that you use feature detection. However, this function is also required in actual projects.
Compatibility
IE6 +, Chrome, Firefox, Safari, and Opera
Framework dependency
Native JS support
Module support
Supports AMD, node, and browsers
Introduction
1. recognition engine, for example:
// If the browser is the core of webkit, execute the following code
If (!! Client. engine. webkit ){
// Todo
}
2. Identify the browser, for example:
// If the IE browser is used and the IE version is 6, run the following code:
If (!! Client. browser. ie & client. browser. ie = 6 ){
// Todo
}
3. Operating System Identification and examples:
// For Windows 7, run the following code:
If (!! Client. system. win & client. system. win = 7 ){
// Todo
}
Download connection
Https://github.com/hehongwei44/userAgent
Authorization information
Authorization type: MIT
Authorization type: https://github.com/hehongwei44/userAgent/blob/master/LICENSE
Change log
Https://github.com/hehongwei44/userAgent/blob/master/ChangeLog.md
Other supplements
A good plug-in, recommended