fingerprintjs 封装, 获取浏览器 visitorId
Available as an npm package
// with npm
npm install fineprint
// with yarn
yarn add fineprint
import { getResultSync, getVisitorIdSync } from "fineprint"
// 获取VisitorId
;(async () => {
const visitorId = await getVisitorIdSync()
const result = await getResultSync()
console.log(visitorId)
console.log(result)
})()
download DEMO
<script src="./dist/fineprint.min.js"></script>
<script>
;(function () {
var finePrint = window.fineprint
// 获取visitorId
finePrint.getVisitorIdSync().then(function (code) {
console.log(code)
})
// 获取所有参数
finePrint.getResultSync().then(function (res) {
console.log(res)
})
})()
</script>