-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
41 lines (36 loc) · 946 Bytes
/
app.js
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
var FingerPrintTester = React.createClass({
getInitialState: function() {
return {
fingerprint: 'Generating...',
fingerprint2: 'Generating...',
};
},
componentDidMount: function() {
this._generateFingerprint();
this._generateFingerprint2();
},
_generateFingerprint: function() {
var fingerprint = new Fingerprint({
canvas: true, ie_activex: true, screen_resolution: true
}).get();
this.setState({ fingerprint: fingerprint });
},
_generateFingerprint2: function() {
new Fingerprint2().get(function (result) {
this.setState({ fingerprint2: result });
}.bind(this));
},
render: function() {
return (
<div>
<h2>Version 1</h2>
<h3>{this.state.fingerprint}</h3>
<h2>Version 2</h2>
<h3>{this.state.fingerprint2}</h3>
</div>
);
},
});
ReactDOM.render(
<FingerPrintTester />, document.getElementById('container')
);