Home  >  Article  >  Backend Development  >  javascript - 如何在服务端利用user-agent精准判断浏览器类型?

javascript - 如何在服务端利用user-agent精准判断浏览器类型?

WBOY
WBOYOriginal
2016-06-06 20:37:04994browse

如果不能使用ua精确判断,请列出你的方案

回复内容:

如果不能使用ua精确判断,请列出你的方案

ua可以由用户在浏览器端改变,所以服务端获取的可能不准。
浏览器厂商为了获取更高的兼容性,可能将它的ua改成主流浏览器的ua,所以服务端获取的可能不准。
综上,用js对浏览器进行能力检测还是最稳定的。
比如 !!window.MozillaTool 返回true那应该是firefox了。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn