Modernizr检查以检测Firefox

Nat*_*tto 4 javascript modernizr

使用modernizr可以检查firefox功能有哪些可能的检查?

pdj*_*ota 19

即使不建议对功能进行浏览器检测,也可以使用它来呈现其他类型的信息.

Modernizr.addTest('firefox', function () {
 return !!navigator.userAgent.match(/firefox/i);
});
Run Code Online (Sandbox Code Playgroud)

这会将类.firefox添加到document.documentElement(html标记)


小智 6

遗憾的是,浏览器检测对于视频和音频等内容仍然是必需的,因为所有浏 我想你会在这里找到答案,纳豆:

http://diveintohtml5.info/detect.html