【问题标题】:browser detection for safari 7Safari 7 的浏览器检测
【发布时间】:2013-11-22 11:34:34
【问题描述】:

如何使用用户代理检测浏览器是否为 safari 7 及更高版本?

here 描述的方法为 safari 7 浏览器返回 Safari 537.71。这对 safari 7 使用安全吗?

【问题讨论】:

    标签: javascript jquery safari user-agent


    【解决方案1】:
    <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>
    

    我想这会解决你的问题

    【讨论】:

    • 它没有解决它,但它有所帮助。我通过浏览控制台中的导航器找到了解决方案。
    • 如果可以,请勾选 ans 是否对您有帮助或点赞 ;)
    猜你喜欢
    • 2011-12-18
    • 2023-03-23
    • 2012-09-19
    • 2011-03-08
    • 1970-01-01
    • 2023-01-18
    • 2019-02-11
    • 2012-04-08
    相关资源
    最近更新 更多