diff --git a/js/legacy.js b/js/legacy.js index e50a64d9..64f565a6 100644 --- a/js/legacy.js +++ b/js/legacy.js @@ -174,9 +174,16 @@ return true; } - // not checking for async/await, ES6 or Promise support, as most - // browsers introduced these earlier then webassembly and webcrypto: - // https://github.com/PrivateBin/PrivateBin/pull/431#issuecomment-493129359 + // async & ES6 support + try { + eval('async () => {}'); + } catch (e) { + if (e instanceof SyntaxError) { + return true; + } else { + throw e; // throws CSP error + } + } return false; } diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index c8ffa8b7..d484edfa 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -71,7 +71,7 @@ if ($MARKDOWN): endif; ?> - +