JavaScript libraries to detect browser capabilities/plug-ins

爷,独闯天下 提交于 2019-12-18 17:14:49

问题


I'm trying to find a (preferably open source) JS library to determine as much information as possible about the user's Web browser environment. I know it's possible to get such data as:

  • Screen resolution,
  • User-Agent, Accept-Language and other preferences usually sent in HTTP headers,
  • Installed plug-ins (through navigator.plugins),
  • Whether a particular browser feature is supported (SVG support, DOM capabilities)

What I'm looking for is a library which gathers such information and makes it available under a common cross-browser interface (there are a bunch of incompatibilties in how browsers report installed plugins, for example). I found Modernizr which can detect HTML5-related functionality, but similar projects which report more generic information, such as the data listed above, would be more useful.


回答1:


I maintain Common Feature Tests project, but it is merely a set of feature tests online, not a library. Feel free to use any of them on your page.

Sometimes I also use this simple test page for testing unknown environments (all tests there are really trivial one liners).




回答2:


You should definitely check out Panopticlick, an academic study (with detailed explanation on theory, and supporting data) to determine what makes a browser installation unique.

Panopticlick uses a slightly outdated version of this plugin detection script...



来源:https://stackoverflow.com/questions/1436994/javascript-libraries-to-detect-browser-capabilities-plug-ins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!