• 检测浏览器内核


    打开即可检测浏览器版本信息: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>
  • 相关阅读:
    短信平台README.MD
    电子保单README.MD
    数据结构和算法(二)
    学习java数据结构和算法笔记(一)
    删除SVN信息
    工作中比较经常用到的命令
    Eclipse不正常关闭后,解决闪退问题
    文字接口数据捕获tcpdump
    Swagger2和springMVC整合测试
    SpringMybatis 整合JavaWeb
  • 原文地址:https://www.cnblogs.com/rlann/p/7289908.html
Copyright © 2020-2023  润新知