有没有办法使fingerprintjs2生成的唯一哈希码在隐身模式下即使在刷新后也是相同的?
这是我的代码,也许代码中有错误?
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
})问题是,在正常浏览模式下,散列保持不变,但在隐身模式下,在刷新和e.t.c之后,它会发生变化
如果在匿名模式下哈希不会改变,我会很满意,即使它在正常浏览模式下是不同的。
谢谢你的帮助,我不是javascript专家,提供的任何帮助都会很有用。
发布于 2020-07-24 20:01:44
在options中,您可以将doNotTrack设置为false
Fingerprint2.getV18({
excludes: {
doNotTrack: false
}
}, (murmur, components) => {
// murmur => your calculated hash
})https://stackoverflow.com/questions/62216005
复制相似问题