const CREATE_CREDENTIAL_ID = "AQIDBA"; const GET_CREDENTIAL_ID = "BQYHCA"; browser.runtime.onMessage.addListener((message) => { if (message?.type === "PASSKEY_HAS_CREDENTIALS") { return Promise.resolve({ ok: true, hasCredentials: true }); } if (message?.type === "PASSKEY_CREATE") { return Promise.resolve({ ok: true, credential: { type: "create", id: CREATE_CREDENTIAL_ID, clientDataJSON: [1], attestationObject: "AQ", authenticatorData: "Ag", publicKey: "Aw", algorithm: -7, }, }); } if (message?.type === "PASSKEY_GET") { return Promise.resolve({ ok: true, credential: { type: "get", id: GET_CREDENTIAL_ID, clientDataJSON: [1], authenticatorData: "Ag", signature: "Aw", userHandle: "BA", }, }); } return undefined; });