safari 7的浏览器检测

browser detection for safari 7

本文关键字:检测 浏览器 safari      更新时间:2023-09-26

如何检测浏览器是否为safari 7以及使用用户代理的其他版本?

这里描述的方法为Safari 7浏览器返回Safari 537.71。这个用于狩猎7号安全吗?

<body>
<div id="example"></div>
<script>
console.log(navigator);
txt = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
txt+= "<p>Browser Name: " + navigator.appName + "</p>";
txt+= "<p>Browser Version: " + navigator.appVersion + "</p>";
txt+= "<p>Cookies Enabled: " + navigator.cookieEnabled + "</p>";
txt+= "<p>Browser Language: " + navigator.language + "</p>";
txt+= "<p>Browser Online: " + navigator.onLine + "</p>";
txt+= "<p>Platform: " + navigator.platform + "</p>";
txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";
txt+= "<p>User-agent language: " + navigator.systemLanguage + "</p>";
document.getElementById("example").innerHTML=txt;
</script>
 </body>
</html>

我认为这将解决您的问题