Add Modernizr warning when running in non-secure context (#28581)

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/28591/head
Michael Telatynski 2024-11-27 15:17:25 +00:00 committed by GitHub
parent bfac727307
commit 9c74110969
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -67,6 +67,10 @@ function checkBrowserFeatures(): boolean {
// although this would start to make (more) assumptions about how rust-crypto loads its wasm.
window.Modernizr.addTest("wasm", () => typeof WebAssembly === "object" && typeof WebAssembly.Module === "function");
// Check that the session is in a secure context otherwise most Crypto & WebRTC APIs will be unavailable
// https://developer.mozilla.org/en-US/docs/Web/API/Window/isSecureContext
window.Modernizr.addTest("securecontext", () => window.isSecureContext);
const featureList = Object.keys(window.Modernizr) as Array<keyof ModernizrStatic>;
let featureComplete = true;