互联网浏览器-检测IE9 64位谷歌工具栏的Javascript

internet explorer - Javascript to detect google toolbar in IE9 64 bit

本文关键字:谷歌 工具栏 Javascript 64位 IE9 浏览器 检测 互联网      更新时间:2023-09-26

为了在IE中检测谷歌工具栏的存在,我注意到在64位环境中,使用IE9,http_user_agent不会显示有关它的信息。

例如,在IE8 中

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; BTRS31753;GTB7.4)

但在IE9 中没有

知道吗?

<html>
    <head>
        <title>Google Toolbar Detection</title>
        <object id="detection" classid="clsid:00EF2092-6AC5-47c0-BD25-CF2D5D657FEB"></object>
    </head>
    <body>
        <script language="javascript" type="text/javascript">
            if (typeof (detection) != "undefined") {
                if (typeof (detection.Search) != "undefined") {
                    document.write("Google Toolbar Installed");
                } else {
                    document.write("Google Toolbar Not Installed");
                }
            } else {
                document.write("This is not MSIE");
            }
        </script>
    </body>
</html>