js获取当前设备的唯一标识

发布时间:2023年12月26日
<script>
    const fpPromise = new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.onload = resolve
        script.onerror = reject
        script.async = true
        script.src = 'https://cdn.jsdelivr.net/npm/'
            + '@fingerprintjs/fingerprintjs@3/dist/fp.min.js'
        document.head.appendChild(script)
    })
        .then(() => FingerprintJS.load())
 
    // Get the visitor identifier when you need it.
    fpPromise.then(fp => fp.get()).then(result => {
        // This is the visitor identifier:
        const visitorId = result.visitorId
        console.log('唯一标识:' + visitorId)
    })
</script>
文章来源:https://blog.csdn.net/qq_22823581/article/details/135225366
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。