We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何获取浏览器的唯一标识,原理是什么
The text was updated successfully, but these errors were encountered:
由于不同的系统显卡绘制 canvas 时渲染参数、抗锯齿等算法不同,因此绘制成图片数据的 CRC 校验也不一样。
canvas
CRC
function getCanvasFp () { const canvas = document.getElementById('canvas') const ctx = canvas.getContext('2d') ctx.font = '14px Arial' ctx.fillStyle = '#ccc' ctx.fillText('hello, shanyue', 2, 2) return canvas.toDataURL('image/jpeg') }
因此根据 canvas 可以获取浏览器指纹信息。
base64
md5
但是对于常见的需求就有成熟的解决方案,若在生产环境使用,可以使用以下库
它依据以下信息,获取到浏览器指纹信息,而这些信息,则成为 component
component
webgl
UserAgent
AudioContext
requestIdleCallback(function () { Fingerprint2.get((components) => { const values = components.map((component) => component.value) const fp = Fingerprint2.x64hash128(values.join(''), 31) }) })
在 fingerprintjs2 中,对于 component 也有分类
fingerprintjs2
在实际业务中,可根据业务选择合适的组件
const options = { excludes: {userAgent: true, language: true} }
根据 canvas 可以获取浏览器指纹信息
若在生产环境使用,可以使用 fingerprintjs2,根据业务需求,如单设备是否可跨浏览器,以此选择合适的 component
Sorry, something went wrong.
canvas指纹
No branches or pull requests
如何获取浏览器的唯一标识,原理是什么
The text was updated successfully, but these errors were encountered: