【发布时间】:2020-09-24 16:47:13
【问题描述】:
有没有办法让指纹js2生成的唯一哈希码在隐身模式下即使在刷新后也一样?
这是我的代码,可能代码有误?
const Fingerprint2 = require("fingerprintjs2");
var options = {}
if (window.requestIdleCallback) {
requestIdleCallback(function () {
Fingerprint2.get(function (components) {
console.log(components) // an array of components: {key: ..., value: ...}
})
})
} else {
setTimeout(function () {
Fingerprint2.get(function (components) {
console.log(components) // an array of components: {key: ..., value: ...}
})
}, 500)
}
Fingerprint2.get(options, function (components) {
var values = components.map(function (component) { return component.value })
var murmur = Fingerprint2.x64hash128(values.join(''), 31)
console.log(murmur) // provides a hash
})
问题是,在正常浏览模式下,哈希保持不变,但在隐身模式下,它会在 refresing 和 e.t.c 后发生变化
如果在隐身模式下哈希不会改变,我会很满意,即使在正常浏览模式下它会是 difffirenet。
感谢您的帮助,我不是 javascript 专家,提供的任何帮助都会很有用。
【问题讨论】:
标签: javascript incognito-mode fingerprintjs2