2022-12-29 14:20:27 +00:00
|
|
|
function fp(fp) {
|
|
|
|
const xhr = new XMLHttpRequest();
|
|
|
|
xhr.open("POST", '/fp/'+fp);
|
|
|
|
xhr.setRequestHeader('xhr', 'xhr');
|
|
|
|
const form = new FormData()
|
|
|
|
form.append("formkey", formkey());
|
|
|
|
xhr.send(form);
|
|
|
|
};
|
|
|
|
|
2023-07-22 21:36:02 +00:00
|
|
|
const fpPromise = import('/assets/js/vendor/fp.js?x=7')
|
|
|
|
.then(FingerprintJS => FingerprintJS.load())
|
2022-12-29 14:20:27 +00:00
|
|
|
|
|
|
|
fpPromise
|
2023-07-22 21:36:02 +00:00
|
|
|
.then(fp => fp.get())
|
|
|
|
.then(result => {
|
|
|
|
console.log(result.requestId, result.visitorId);
|
|
|
|
fp(result.visitorId);
|
|
|
|
})
|