diff --git a/auth/index.html b/auth/index.html index 998a04c..b1f742c 100644 --- a/auth/index.html +++ b/auth/index.html @@ -1070,6 +1070,32 @@

Message log

document.addEventListener( "DOMContentLoaded", async function () { + if (navigator.storage && navigator.storage.persist) { + navigator.storage.persist().then((persistent) => { + if (persistent) { + console.log( + "Storage will not be cleared except by explicit user action" + ); + } else { + console.log( + "Storage may be cleared by the UA under storage pressure." + ); + } + }); + } + + var promise = document.requestStorageAccess(); + promise.then( + function (arg) { + // Storage access was granted. + console.log("got perms", arg); + }, + function (arg) { + // Storage access was denied. + console.log("no perms", arg); + } + ); + await TKHQ.initEmbeddedKey(); var embeddedKeyJwk = await TKHQ.getEmbeddedKey(); var targetPubBuf = await TKHQ.p256JWKPrivateToPublic(embeddedKeyJwk);