making feature detection work as intended in chrome

This commit is contained in:
El RIDO 2019-08-27 23:16:06 +02:00
parent 6fcd82fb85
commit a6aef109cc
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
5 changed files with 30 additions and 26 deletions

View file

@ -566,10 +566,10 @@ jQuery.PrivateBin = (function($, RawDeflate) {
// if $element is given, apply text to element
if ($element !== null) {
// get last text node of element
// set the last text node of element
let content = $element.contents();
if (content.length > 1) {
content[content.length - 1].nodeValue = ' ' + output;
$element.html(' ' + output).prepend(content[0]);
} else {
$element.text(output);
}
@ -4803,11 +4803,21 @@ jQuery.PrivateBin = (function($, RawDeflate) {
*/
function isOldBrowser() {
// webcrypto support
if (typeof window.crypto !== 'object') {
if (!(
'crypto' in window &&
'getRandomValues' in window.crypto &&
'subtle' in window.crypto &&
'encrypt' in window.crypto.subtle &&
'decrypt' in window.crypto.subtle &&
'Uint32Array' in window
)) {
return true;
}
if (typeof WebAssembly !== 'object' && typeof WebAssembly.instantiate !== 'function') {
if (!(
'WebAssembly' in window &&
'instantiate' in window.WebAssembly
)) {
return true;
}
try {