Require a browser fingerprint if requested (do not fail gracefully)

This commit is contained in:
RunasSudo 2018-03-26 21:36:14 +11:00
parent b6c0170748
commit ca084d3207
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 12 additions and 9 deletions

View File

@ -48,16 +48,11 @@
// String.prototype.join confuses fingerprintjs2
var strjoin = String.prototype.join;
String.prototype.join = undefined;
try {
new Fingerprint2().get(function(result, components) {
String.prototype.join = strjoin;
booth.fingerprint = components;
nextTemplate();
});
} catch (ex) {
console.error(ex);
new Fingerprint2().get(function(result, components) {
String.prototype.join = strjoin;
booth.fingerprint = components;
nextTemplate();
}
});
} else {
nextTemplate();
}

View File

@ -67,6 +67,14 @@
resetBooth();
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" })
.done(function(data) {
try {