Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug]: WebKit's injected PublicKeyCredential is a plain object, so WebAuthn libraries report no support

Aperta
#43,711 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@microsoft-playwright-automation ci sta già lavorando.

Dal 29/10/2026.

  • #43775 di @microsoft-playwright-automation — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, playwright, typescript
Ambito
testing

Direzione di ricerca

Start with wkPage.ts and _publicKeyCredentialScript, identified in the issue, then check the WebKit tests for the injected PublicKeyCredential and compare its shape with Chromium's. Reproduce with the supplied typeof window.PublicKeyCredential test under the WebKit project. Done when it reports "function" and WebAuthn library feature checks recognize support.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs-triage-win
Version

1.64.1

Steps to reproduce
import { test, expect } from "@playwright/test";

test("PublicKeyCredential is a constructor", async ({ page }) => {
  await page.goto("https://example.com");
  const kind = await page.evaluate(() => typeof window.PublicKeyCredential);
  expect(kind).toBe("function");
});

Run it with --project webkit (WebKit 27.2 on Windows; devices["iPhone 17"] gives the same), both with and without context.credentials.install() first.

Expected behavior

typeof PublicKeyCredential is "function", as in Chromium (where the same test passes) and in Safari. PublicKeyCredential is an interface object, and feature checks across the WebAuthn ecosystem test for a function. @simplewebauthn/browser 13.3.0's browserSupportsWebAuthn() reads:

return globalThis?.PublicKeyCredential !== undefined && typeof globalThis.PublicKeyCredential === 'function';
Actual behavior

typeof PublicKeyCredential is "object", and String(PublicKeyCredential) is "[object Object]". The WebKit page bootstrap (wkPage.ts :: _publicKeyCredentialScript) runs window.PublicKeyCredential ??= { getClientCapabilities, isConditionalMediationAvailable, isUserVerifyingPlatformAuthenticatorAvailable }, so a plain object fills the global.

Because of that, any app whose passkey ceremony goes through @simplewebauthn/browser (directly, or through an auth library's passkey client) throws "WebAuthn is not supported in this browser" under Playwright's WebKit before navigator.credentials.create is ever called. Calling navigator.credentials.create directly works, so the credentials API is fine. Only the shape of the stand-in global trips library feature checks.

Additional context

A function stand-in would keep the static methods and satisfy the check, for example window.PublicKeyCredential ??= Object.assign(function PublicKeyCredential() { throw new TypeError("Illegal constructor"); }, { getClientCapabilities, isConditionalMediationAvailable, isUserVerifyingPlatformAuthenticatorAvailable }).

Environment
- Operating System: Windows 11
- Browser: WebKit 27.2 (Playwright 1.64.1)
- Library: @simplewebauthn/browser 13.3.0
Lingua principale
TypeScript
Stelle
98.5k
Fork
6.7k
Merge medio
15h 42m
PR unite (30g)
313

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/playwright

Tutte le issue di microsoft/playwright

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.