Require a browser fingerprint if requested (do not fail gracefully)
This commit is contained in:
parent
b6c0170748
commit
ca084d3207
@ -48,16 +48,11 @@
|
|||||||
// String.prototype.join confuses fingerprintjs2
|
// String.prototype.join confuses fingerprintjs2
|
||||||
var strjoin = String.prototype.join;
|
var strjoin = String.prototype.join;
|
||||||
String.prototype.join = undefined;
|
String.prototype.join = undefined;
|
||||||
try {
|
new Fingerprint2().get(function(result, components) {
|
||||||
new Fingerprint2().get(function(result, components) {
|
String.prototype.join = strjoin;
|
||||||
String.prototype.join = strjoin;
|
booth.fingerprint = components;
|
||||||
booth.fingerprint = components;
|
|
||||||
nextTemplate();
|
|
||||||
});
|
|
||||||
} catch (ex) {
|
|
||||||
console.error(ex);
|
|
||||||
nextTemplate();
|
nextTemplate();
|
||||||
}
|
});
|
||||||
} else {
|
} else {
|
||||||
nextTemplate();
|
nextTemplate();
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,14 @@
|
|||||||
resetBooth();
|
resetBooth();
|
||||||
|
|
||||||
function loadElection() {
|
function loadElection() {
|
||||||
|
// Verify booth
|
||||||
|
if (should_do_fingerprint) {
|
||||||
|
if (typeof Fingerprint2 === 'undefined') {
|
||||||
|
boothError('Your browser did not load fingerprintj2 correctly. Please try again after disabling your ad blockers and similar software. If the issue persists, try using a different browser.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({ url: "{{ url_for('election_api_json', election_id=election._id) }}", dataType: "text" })
|
$.ajax({ url: "{{ url_for('election_api_json', election_id=election._id) }}", dataType: "text" })
|
||||||
.done(function(data) {
|
.done(function(data) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user