Modernizr checks to detect firefox [closed]

烈酒焚心 提交于 2020-01-01 05:49:06

问题


What are the possible checks can be made to detect firefox features using modernizr?


回答1:


Browser detection is unfortunately still necessary for things like video and audio since all browsers promote different formats. I think you'll find your answer here, Natto:

http://diveintohtml5.info/detect.html




回答2:


Even if browser detection is not recommended for features it could be use to present other type of information.

Modernizr.addTest('firefox', function () {
 return !!navigator.userAgent.match(/firefox/i);
});

This adds a class .firefox to document.documentElement (html tag)



来源:https://stackoverflow.com/questions/11318389/modernizr-checks-to-detect-firefox

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