mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-05-02 06:26:16 -04:00
correcting old browser detection logic, fixes #446
This commit is contained in:
parent
fdc532b3c1
commit
67b9b5f0d8
4 changed files with 9 additions and 10 deletions
|
@ -4580,11 +4580,11 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
function isOldBrowser() {
|
||||
// webcrypto support
|
||||
if (typeof window.crypto !== 'object') {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof WebAssembly !== 'object' && typeof WebAssembly.instantiate !== 'function') {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
// [\0, 'a', 's', 'm', (uint_32) 1] - smallest valid wasm module
|
||||
|
@ -4595,17 +4595,17 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
new WebAssembly.Instance(module) instanceof WebAssembly.Instance
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// not checking for async/await, ES6, Promise or Uint8Array support,
|
||||
// as most browsers introduced these earlier then webassembly and webcrypto:
|
||||
// https://github.com/PrivateBin/PrivateBin/pull/431#issuecomment-493129359
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue