forked from fingerprintjs/fingerprintjs
-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
107 lines (94 loc) · 2.99 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!doctype html>
<html>
<head>
<title>Fingerprintjs2 test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-42202458-2', 'auto');
ga('send', 'pageview');
</script>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<style>
body{
font-family: sans-serif;
max-width: 48em;
margin: auto;
padding: 0 5%;
background: #222;
color: #fff;
}
h1 {
margin: 2em 0 0;
}
p {
font-size: 1.2em
}
button {
border: none;
color: #fff;
font-size: 1.2em;
background: #27e;
padding: 0.5em 0.75em 0.6em;
border-radius: 3px;
box-shadow: 0 3px 0 #05c;
outline: none;
}
button:active {
transform: translateY(3px);
box-shadow: none;
}
strong {
display: block;
letter-spacing: 1px;
word-wrap: break-word;
}
@media (min-width: 32em) {
h1 {
font-size: 4em;
}
strong {
font-size: 1.5em;
}
}
</style>
</head>
<body>
<div id="container"></div>
<h1>Fingerprintjs2</h1>
<p>Your browser fingerprint: <strong id="fp"></strong></p>
<p><code id="time"/></p>
<p><span id="details"/></p>
<button type="button" id="btn">Get my fingerprint</button>
<a href="https://github.com/Valve/fingerprintjs2"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
<script src="fingerprint2.js"></script>
<script>
$("#btn").on("click", function () {
var d1 = new Date();
var fp = new Fingerprint2();
fp.get(function(result, components) {
var d2 = new Date();
var timeString = "Time took to calculate the fingerprint: " + (d2 - d1) + "ms";
var details = "<strong>Detailed information: </strong><br />";
if(typeof window.console !== "undefined") {
console.log(timeString);
console.log(result);
for (var index in components) {
var obj = components[index];
var value = obj.value;
var line = obj.key + " = " + value.toString().substr(0, 100);
console.log(line);
details += line + "<br />";
}
}
$("#details").html(details);
$("#fp").text(result);
$("#time").text(timeString);
});
});
</script>
</body>
</html>