Goolge的Gmail使用的Javascript代码

var  BrowserSupport_  =   {
    IsBrowserSupported : 
function() {
        
var agt = navigator.userAgent.toLowerCase();
        
var is_op = (agt.indexOf("opera"!= -1);
        
var is_ie = (agt.indexOf("msie"!= -1&& document.all && !is_op;
        
var is_ie5 = (agt.indexOf("msie 5"!= -1&& document.all && !is_op;
        
var is_mac = (agt.indexOf("mac"!= -1);
        
var is_gk = (agt.indexOf("gecko"!= -1);
        
var is_sf = (agt.indexOf("safari"!= -1);
        
if (is_ie && !is_op && !is_mac) {
            
if (agt.indexOf("palmsource"!= -1 ||
                agt.indexOf(
"regking"!= -1 ||
                agt.indexOf(
"windows ce"!= -1 ||
                agt.indexOf(
"j2me"!= -1 ||
                agt.indexOf(
"avantgo"!= -1 ||
                agt.indexOf(
" stb"!= -1)  {
                
return false;
            }

            
var v = BrowserSupport_.GetFollowingFloat(agt, "msie ");
            
if (v != null{
                
return (v >= 5.5);
            }

        }

        
if (is_gk && !is_sf) {
            
var v = BrowserSupport_.GetFollowingFloat(agt, "rv:");
            
if (v != null{
                
return (v >= 1.4);
            }
 else {
                v 
= BrowserSupport_.GetFollowingFloat(agt, "galeon/");
                
if (v != null{
                    
return (v >= 1.3);
                }

            }

        }
        
        
if (is_sf) {
            
var v = BrowserSupport_.GetFollowingFloat(agt, "applewebkit/");
            
if (v != null{
                
return (v >= 312);
            }

        }
        
        
if (is_op) {
            
if (agt.indexOf("sony/com1"!= -1{
                
return false;
            }

            
// Could have "Opera 8.0" or "Opera/8.0".
            var v = BrowserSupport_.GetFollowingFloat(agt, "opera ");
            
if (v == null{
                v 
= BrowserSupport_.GetFollowingFloat(agt, "opera/");
            }

            
if (v != null{
                
return (v >= 8.0);
            }

        }

        
return false;
    }
,
    GetFollowingFloat : 
function(str, pfx) {
        
var i = str.indexOf(pfx);
        
if (i != -1{
            
var v = parseFloat(str.substring(i + pfx.length));
            
if (!isNaN(v)) {
                
return v;
            }

        }

        
return null;
    }
,
    tz_path : 
';path=/'
}
;
if  (window.location.href.toLowerCase().indexOf( ' google.com ' >   0 {
    BrowserSupport_.tz_path 
+= ';domain=.google.com';
}

document.cookie 
=   " TZ= "   +  ( new  Date()).getTimezoneOffset()  + BrowserSupport_.tz_path;
var  is_browser_supported  =  BrowserSupport_.IsBrowserSupported();
var  fs_time = ( new  Date()).getTime();
function  wfs()  {
    
try {
        
if (parent!=window && parent.wfs) {
            
return false;
        }

    }
catch(e){}
    
if (top.location.href.indexOf('nocheckbrowser')!=-1{
        
return true;
    }

    
if (!is_browser_supported) {
        top.location
="?ui=html&zy=j";
        
return false;
    }

    
var testcookie='jscookietest=valid';
    document.cookie
=testcookie;
    
if (document.cookie.indexOf(testcookie)==-1{
        top.location
="html/zh-CN/nocookies.html";
        
return false;
    }

    document.cookie
=testcookie+';expires=Thu, 01 Jan 1970 00:00:00 GMT';
    
var agt=navigator.userAgent.toLowerCase();
    
if (agt.indexOf('msie')!=-1 && document.all &&
        agt.indexOf(
'opera')==-1 && agt.indexOf('mac')==-1{
        eval(
'var c=(agt.indexOf("msie 5")!=-1)?"Microsoft.XMLHTTP":"Msxml2.XMLHTTP";try{new ActiveXObject(c);}catch(e){top.location="html/zh-CN/noactivex.html";}');
    }

    
return true;
}

function  lj()  {
    js.location.replace(
"?view=page&name=js&ver=v1vwsce81qqi");
}

if  (wfs())  {
    document.write(
'<frameset οnlοad=lj() rows="100%,*" border=0><frame name=main src="?view=page&amp;name=loading&amp;ver=19a0igg368czx" frameborder=0 noresize scrolling=no><frame name=js src="?view=page&amp;name=loading&amp;ver=19a0igg368czx" frameborder=0 noresize></frameset>');
}
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值