Skip to content

[Bug]: PublicKeyCredential is undefined in webkit for debian #35433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
noahbald opened this issue Apr 1, 2025 · 5 comments · May be fixed by #35702
Open

[Bug]: PublicKeyCredential is undefined in webkit for debian #35433

noahbald opened this issue Apr 1, 2025 · 5 comments · May be fixed by #35702

Comments

@noahbald
Copy link

noahbald commented Apr 1, 2025

Version

1.50.1

Steps to reproduce

Set up a test similar to this.

test.describe("PublicKeyCredential", () => {
  test("it should be defined", async ({ page }) => {
    await page.goto("about://blank");
    const isPasskeysSupported = await page.evaluate(() => globalThis.PublicKeyCredential !== undefined);
    expect(isPasskeysSupported).toBe(true);
  });
});

When running this locally, all tests work (on mac).
When running this via ci, webkit fails (debian).

Expected behavior

Local tests should be the same as ci tests. However in ci, PublicKeyCredential is not available

Actual behavior

PublicKeyCredential is not defined in webkit for debian

Additional context

No response

Environment

System:
    OS: macOS 15.3.2
    CPU: (12) arm64 Apple M2 Pro
    Memory: 2.17 GB / 32.00 GB
  Binaries:
    Node: 20.18.3 - ~/.asdf/installs/nodejs/20.18.3/bin/node
    npm: 10.8.2 - ~/.asdf/installs/nodejs/20.18.3/bin/npm
    pnpm: 9.15.9 - ~/.asdf/installs/nodejs/20.18.3/bin/pnpm
    bun: 1.2.5 - /opt/homebrew/bin/bun
  IDEs:
    VSCode: 1.90.0 - /usr/local/bin/code
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: ^1.50.1 => 1.50.1
@Skn0tt
Copy link
Member

Skn0tt commented Apr 1, 2025

Can repro. Looks like WPE on linux doesn't support WebAuthn. We're tracking general support for that in #7276.

@Skn0tt Skn0tt closed this as completed Apr 1, 2025
@Skn0tt Skn0tt reopened this Apr 1, 2025
@Skn0tt
Copy link
Member

Skn0tt commented Apr 1, 2025

Wait, closed too fast. Could you elaborate why this matters to you? If your page is crashing because PublicKeyCredential isn't defined, we could implement a stub for it until #7276 is resolved.

@noahbald
Copy link
Author

noahbald commented Apr 1, 2025

Thanks, it's not particularly important now since we can skip the test when PublicKeyCredential isn't defined, it was just something that was quite tedious to debug.

It didn't cause any crashing, but rather we had tests failing since we check if PublicKeyCredential is undefined as a way to check browser support, and in that case we show different content than our expect() expects.

@noahbald
Copy link
Author

noahbald commented Apr 1, 2025

Also just to note, this is a test that doesn't actually use passkeys, but is adjacent to it, if that makes sense? So in this scenario stubbing it might help, if that's something worth doing. That way we could run ci tests in webkit rather than skipping it

@Skn0tt
Copy link
Member

Skn0tt commented Apr 2, 2025

Makes sense. I think if we stub out PublicKeyCredential and make isUserVerifyingPlatformAuthenticatorAvailable return false, that should already help lots of sites because their normal passkey support detection continues working.

@Skn0tt Skn0tt added the v1.53 label Apr 2, 2025
@Skn0tt Skn0tt self-assigned this Apr 2, 2025
@Skn0tt Skn0tt linked a pull request Apr 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants