检测浏览器内核
Posted 梦见一只电子羊
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了检测浏览器内核相关的知识,希望对你有一定的参考价值。
打开即可检测浏览器版本信息: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>
以上是关于检测浏览器内核的主要内容,如果未能解决你的问题,请参考以下文章
什么是在 C++ 中获取总内核数量的跨平台代码片段? [复制]