Home  >  Article  >  Web Front-end  >  Use js to determine whether it is the implementation code of 360 browser_javascript skills

Use js to determine whether it is the implementation code of 360 browser_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:19:501509browse

The following code is available in 360 Safe Browser 5 and 6 versions

<script>
var check360browser={
//如果是360 浏览器的话
"ok":function (){
//这里是判断360成功之后的代码
alert('js -> 360');
},
"try360SE":function (callback) {  
var ret = false,    
img = new Image();  
img.src = 'res://360se.exe/2/2025';  
img.onload = function() {   
ret = true;  
}  
setTimeout(function() {   
if(ret==true){
check360browser.ok();
}else{
ret=check360browser.try360SE_2();
if(ret){
check360browser.ok();
}
}
}, 100); 
},
"try360SE_2":function (){  
var is360 = false;  
if(window.navigator.userAgent.indexOf('Chrome')!=-1){ 
if(window.navigator.webkitPersistentStorage){ 
 
}else{ 
return true; 
} 
} 
}
}
check360browser.try360SE();
</script>
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