Created
January 31, 2020 23:24
-
-
Save michaelklem/b55572170868db3c70d40f7a3579e68b to your computer and use it in GitHub Desktop.
FingerprintJS Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"<div id='app' class='col-md-6 col-md-offset-3'> | |
<h1>FingerprintJS2</h1> | |
<p> | |
<button @click='fetchFingerprint' class='btn btn-xs btn-default'>Refresh</button> | |
Your fp: <b>{{ fingerprint }}</b> | |
</p> | |
<table class='table'> | |
<tbody> | |
<tr v-for='component in fpComponents'> | |
<td>{{ component.key }}</td> | |
<td>{{ component.value }}</td> | |
</tr> | |
</tbody> | |
</table> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
el: '#app', | |
data: { | |
fingerprint: '', | |
fpComponents: [], | |
fpOptions: { | |
excludeAdBlock: true | |
} | |
}, | |
methods: { | |
fetchFingerprint(){ | |
var options = {excludes:{ fonts: true, fontsFlash: true, enumerateDevices: true, pixelRatio: true, doNotTrack: true}}; | |
Fingerprint2().get((result, components) => { | |
this.fingerprint = result; | |
this.fpComponents = components; | |
console.log(components); // an array of FP components | |
}) | |
} | |
}, | |
created(){ | |
this.fetchFingerprint(); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.3/vue.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/fingerprintjs2/1.8.0/fingerprint2.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table { | |
table-layout: fixed; | |
word-wrap: break-word; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment