【问题标题】:Angularjs - client browser fingerprintAngularjs - 客户端浏览器指纹
【发布时间】:2017-01-02 12:51:27
【问题描述】:

是否有任何用于基于 Angular 的前端的 js 插件,它具有收集数据的标准方法,用于基于浏览器指纹库(如指纹 2.js 或 clientjs)对用户进行分析?

【问题讨论】:

    标签: angularjs browser-detection browser-feature-detection fingerprintjs2


    【解决方案1】:

    我认为 AngularJS 或 Angular 2/4 中没有解决这个问题的方法。

    但我已经设法使用以下方法做到了这一点。任何一个都行 -

    1. clientjs.org
    2. Custom working example

    基本上,上述两种方式都会读取 localstorage 以检查是否已存储 10 位数字(带有密钥名称)。如果有,只需使用它或生成新的并将其存储在本地存储中。

    return checksum([
        navigator.userAgent,
        [screen.height, screen.width, screen.colorDepth].join('x'),
        new Date().getTimezoneOffset(),
        !!window.sessionStorage,
        !!window.localStorage,
        map(navigator.plugins, function (plugin) {
            return [
                plugin.name,
                plugin.description,
                map(plugin, function (mime) {
                    return [mime.type, mime.suffixes].join('~');
                }).join(',')
            ].join("::");
        }).join(';')
    ].join('###'));
    

    【讨论】:

      猜你喜欢
      • 2013-07-23
      • 1970-01-01
      • 2021-04-23
      • 2019-06-13
      • 2016-05-08
      • 1970-01-01
      • 2022-01-13
      • 2011-01-01
      • 2012-08-23
      相关资源
      最近更新 更多