首页 > 代码库 > 检测浏览器内核
检测浏览器内核
打开即可检测浏览器版本信息:https://lanleilin.github.io/checkBrowser/index.html
window.onload=function(){ 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>Platform: " + navigator.platform + "</p>"; txt+= "<p class=‘platform‘>User-agent header: " + navigator.userAgent + "</p>"; txt+= "<p>User-agent language: " + navigator.systemLanguage + "</p>"; document.getElementById("example").innerHTML=txt; var isUcb=navigator.appVersion+‘‘; if(isUcb.indexOf(‘UCBrowser‘)>-1) { document.body.style.backgroundColor=‘#000000‘; document.body.style.color=‘#FFFFFF‘; } function setColor(){ this.arr=[0,1,2,3,4,5,6,7,8,9,‘a‘,‘b‘,‘c‘,‘d‘,‘e‘,‘f‘]; this.lanH1=document.getElementsByClassName(‘platform‘)[0]; this.title=document.getElementById(‘title‘); this.color=‘#‘+ this.arr[parseInt(Math.random()*16)]+ this.arr[parseInt(Math.random()*16)]+ this.arr[parseInt(Math.random()*16)]+ this.arr[parseInt(Math.random()*16)]+ this.arr[parseInt(Math.random()*16)]+ this.arr[parseInt(Math.random()*16)]; this.lanH1.style.color=this.color; this.title.style.color=this.color; } new setColor(); clearInterval(); setInterval(function(){ new setColor(); },10000); }
html:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script src="js/check.js" type="text/javascript" charset="utf-8"></script> </head> <body> <h1>浏览器 <span id="title">KERNEL</span> </h1> <p id="example"></p> </body> </html>
检测浏览器内核
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。