correcting old browser detection logic, fixes #446

This commit is contained in:
El RIDO 2019-06-27 20:11:22 +02:00
parent fdc532b3c1
commit 67b9b5f0d8
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
4 changed files with 9 additions and 10 deletions

View file

@ -22,6 +22,7 @@ describe('InitialCheck', function () {
'</body></html>'
);
$.PrivateBin.Alert.init();
window.crypto = null;
const result1 = !$.PrivateBin.InitialCheck.init(),
result2 = !$('#errormessage').hasClass('hidden');
clean();
@ -48,13 +49,10 @@ describe('InitialCheck', function () {
'<html><body><div id="errormessage" class="hidden"></div>'+
'<div id="oldnotice" class="hidden"></div></body></html>'
);
const crypto = window.crypto;
window.crypto = null;
$.PrivateBin.Alert.init();
const result1 = !$.PrivateBin.InitialCheck.init(),
result2 = isSecureContext === $('#errormessage').hasClass('hidden'),
result3 = !$('#oldnotice').hasClass('hidden');
window.crypto = crypto;
clean();
return result1 && result2 && result3;
}
@ -78,6 +76,7 @@ describe('InitialCheck', function () {
'</body></html>'
);
$.PrivateBin.Alert.init();
window.crypto = null;
const result1 = $.PrivateBin.InitialCheck.init(),
result2 = isSecureContext === $('#httpnotice').hasClass('hidden');
clean();