From 8942e5bd49280d1d5d5fafc2f1f9e05c5cc470df Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Fri, 26 Jun 2026 11:58:49 +0800 Subject: [PATCH] feat: add support for PRF extension request based on browser compatibility --- webapp/src/lib/account-passkeys.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webapp/src/lib/account-passkeys.ts b/webapp/src/lib/account-passkeys.ts index a1efbdf..87ce7a3 100644 --- a/webapp/src/lib/account-passkeys.ts +++ b/webapp/src/lib/account-passkeys.ts @@ -161,6 +161,11 @@ function shouldRetryCreateWithoutPrf(error: unknown): boolean { ); } +async function canRequestPrfExtension(): Promise { + if (/\bFirefox\//i.test(navigator.userAgent)) return false; + return true; +} + async function getPublicKeyCredentialWithPrf( options: PublicKeyCredentialRequestOptions, salt: Uint8Array, @@ -291,7 +296,7 @@ export async function createAccountPasskeyCredential( return credential; }; let credential: PublicKeyCredential; - if (requestPrf) { + if (requestPrf && await canRequestPrfExtension()) { const prfOptions: PublicKeyCredentialCreationOptions = { ...nativeOptions, extensions: {