行为分析工具开发笔记

1、客户端设备信息:

浏览器端:

        navigator.userAgent.toLowerCase()   //获取浏览器及版本,如chrome  64.2121
        let ua = navigator.userAgent.toLowerCase();
        let re =/(msie|firefox|chrome|opera|version).*?([\d.]+)/;
        let m = ua.match(re);
        sys.brow = m[1].replace(/version/, "'safari");
        sys.v = m[2];
        return sys;


        //获取硬件平台,win32
        var plateform = navigator.platform ? navigator.platform : "unknown";

        //内存????
        var memory = navigator.deviceMemory ? navigator.deviceMemory : 0;

        //cookie 是否开启
         var cookie_bool = navigator.cookieEnabled;

         location.hash = "win"; //给url加上锚点,此锚点会自动加载到url的,即url尾部加了个XXX.html#win

        //监听当url发生变化时:
        window.addEventLister("hashchange",bind(this));

        //点击后退按钮触发:
        window.onpopstate = function(){}

        //console.log ("This device has at least " + memory + "GiB of RAM.")

        //获取用户主机名
        location.hostname

        window.location.hostname

        //浏览器供应商
        navigator.vendor


        screen.width + "*" + screen.height

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值