forked from MarseyWorld/MarseyWorld
update fp.js
parent
d0c7524154
commit
795320307a
|
@ -1,5 +1,3 @@
|
||||||
const fp_token = document.getElementById('fp_token').value
|
|
||||||
|
|
||||||
function fp(fp) {
|
function fp(fp) {
|
||||||
const xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.open("POST", '/fp/'+fp);
|
xhr.open("POST", '/fp/'+fp);
|
||||||
|
@ -9,16 +7,12 @@ function fp(fp) {
|
||||||
xhr.send(form);
|
xhr.send(form);
|
||||||
};
|
};
|
||||||
|
|
||||||
const fpPromise = new Promise((resolve, reject) => {
|
const fpPromise = import('/assets/js/vendor/fp.js?x=7')
|
||||||
const script = document.createElement('script');
|
.then(FingerprintJS => FingerprintJS.load())
|
||||||
script.onload = resolve;
|
|
||||||
script.onerror = reject;
|
|
||||||
script.async = true;
|
|
||||||
script.src = "/assets/js/vendor/fp.js?x=6";
|
|
||||||
document.head.appendChild(script);
|
|
||||||
})
|
|
||||||
.then(() => FingerprintJS.load({token: fp_token}));
|
|
||||||
|
|
||||||
fpPromise
|
fpPromise
|
||||||
.then(fp => fp.get())
|
.then(fp => fp.get())
|
||||||
.then(result => {fp(result.visitorId);})
|
.then(result => {
|
||||||
|
console.log(result.requestId, result.visitorId);
|
||||||
|
fp(result.visitorId);
|
||||||
|
})
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -169,7 +169,6 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if FP and request.path == '/' and v and not v.fp %}
|
{% if FP and request.path == '/' and v and not v.fp %}
|
||||||
<input hidden id="fp_token" value="{{FP}}">
|
|
||||||
<script defer src="{{'js/fp.js' | asset}}"></script>
|
<script defer src="{{'js/fp.js' | asset}}"></script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,5 @@ add_header Referrer-Policy "same-origin";
|
||||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
|
||||||
add_header X-Frame-Options "deny";
|
add_header X-Frame-Options "deny";
|
||||||
add_header X-Content-Type-Options "nosniff";
|
add_header X-Content-Type-Options "nosniff";
|
||||||
add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'; form-action 'self'; manifest-src 'self'; worker-src 'self'; base-uri 'self'; font-src 'self'; style-src-elem 'self'; style-src-attr 'unsafe-inline'; style-src 'self' 'unsafe-inline'; script-src-elem 'self' challenges.cloudflare.com; script-src-attr 'none'; script-src 'self' challenges.cloudflare.com; media-src 'self' https:; img-src 'self' https: data:; frame-src challenges.cloudflare.com www.youtube-nocookie.com platform.twitter.com rumble.com player.twitch.tv; connect-src 'self' tls-use1.fpapi.io api.fpjs.io;";
|
add_header Content-Security-Policy "default-src 'none'; frame-ancestors 'none'; form-action 'self'; manifest-src 'self'; worker-src 'self'; base-uri 'self'; font-src 'self'; style-src-elem 'self'; style-src-attr 'unsafe-inline'; style-src 'self' 'unsafe-inline'; script-src-elem 'self' challenges.cloudflare.com; script-src-attr 'none'; script-src 'self' challenges.cloudflare.com; media-src 'self' https:; img-src 'self' https: data:; frame-src challenges.cloudflare.com www.youtube-nocookie.com platform.twitter.com rumble.com player.twitch.tv; connect-src 'self' use1.fptls.com use1.fptls3.com api.fpjs.io;";
|
||||||
add_header Cross-Origin-Opener-Policy "same-origin";
|
add_header Cross-Origin-Opener-Policy "same-origin";
|
||||||
|
|
Loading…
Reference in New Issue