electron/docs/api
trop[bot] 2d943ef610
feat: support WebAuthn Touch ID platform authenticator on macOS (#51411)
* feat: support WebAuthn Touch ID platform authenticator on macOS

Adds `app.configureWebAuthn({ touchID: { keychainAccessGroup } })` to enable
the Secure Enclave platform authenticator for `navigator.credentials`.
Credentials are stored under the app-supplied keychain access group with a
per-session metadata secret that is generated on first use and persisted in
prefs.

Also introduces `ElectronAuthenticatorRequestClientDelegate` and wires it via
`ContentBrowserClient::GetWebAuthenticationRequestDelegate()` so that
discoverable-credential `get()` calls with multiple matches emit a new
`select-webauthn-account` session event instead of DCHECK-failing in the base
delegate. If no listener is registered (or the callback is invoked with no
credential), the request is cancelled with NotAllowedError rather than
silently auto-selecting.

Tests use the DevTools virtual authenticator so the account-selection flow is
exercised in CI without entitlements or real hardware.

Co-authored-by: Samuel Attard <sattard@anthropic.com>

* fix: register request delegate as FidoRequestHandlerBase observer

The base AuthenticatorRequestClientDelegate::StartObserving() is a no-op, so
observer() on the request handler stayed null. MakeCredentialRequestHandler::
SpecializeRequestForAuthenticator dereferences observer()->SupportsPIN() when
residentKey is 'preferred', crashing with SEGV when a real FIDO2 HID key is
dispatched.

Override StartObserving/StopObserving to register via a ScopedObservation like
ChromeAuthenticatorRequestDelegate does. Added a virtual-authenticator
regression test for create() with residentKey: 'preferred'.

Co-authored-by: Samuel Attard <sattard@anthropic.com>

* chore: update copyright attribution for new webauthn files

Co-authored-by: Samuel Attard <sattard@anthropic.com>

* fix: address review feedback on webauthn account-select event

- Encode credentialId and userHandle as URL-safe base64 without padding so
  the values match PublicKeyCredential.id from navigator.credentials.get()
  byte-for-byte; tests now assert the equality rather than transcoding.
- Cancel the pending request when the listener invokes the callback with a
  credentialId that does not match any account, instead of leaving the
  request hanging while the listener retries. The TypeError still surfaces
  so the misuse remains visible to the developer.
- DCHECK that the Touch ID config helpers run on the UI thread, encoding
  the threading invariant the read-then-write metadata-secret pref relies
  on.

Co-authored-by: Samuel Attard <sattard@anthropic.com>

* fix: oxfmt formatting in webauthn spec

Co-authored-by: Samuel Attard <sattard@anthropic.com>

* fix: use out-param form of base::Base64UrlEncode

Co-authored-by: Samuel Attard <sattard@anthropic.com>

* fix: silently cancel webauthn account select on unknown credentialId

Throwing back into the listener bubbles up as an unhandled exception in
the main process. Match the no-args branch exactly so the listener sees a
single consistent failure mode (cancel + NotAllowedError) whether it
declines deliberately or by mistake.

Co-authored-by: Samuel Attard <sattard@anthropic.com>

* chore: node script/lint.js --js --fix

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <sattard@anthropic.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-05-01 11:15:13 -04:00
..
structures feat: support WebAuthn Touch ID platform authenticator on macOS (#51411) 2026-05-01 11:15:13 -04:00
app.md feat: support WebAuthn Touch ID platform authenticator on macOS (#51411) 2026-05-01 11:15:13 -04:00
auto-updater.md feat: msix auto-updater (#49230) 2026-01-29 16:38:26 -05:00
base-window.md docs: note required windows in 'new-window-for-tab' event (#49851) 2026-02-18 19:30:43 -08:00
browser-view.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
browser-window.md docs: note required windows in 'new-window-for-tab' event (#49851) 2026-02-18 19:30:43 -08:00
client-request.md docs: fix typos across documentation (#49734) 2026-02-11 12:45:46 +01:00
clipboard.md docs: add more api history (C-D) (#49510) 2026-03-05 11:30:20 +01:00
command-line-switches.md feat: add support for --experimental-transform-types (#49711) 2026-02-19 20:27:49 +01:00
command-line.md chore: lint code blocks in docs with ESLint (#42113) 2025-05-29 12:45:26 -07:00
content-tracing.md feat: support heap profiling in contentTracing (#51162) 2026-04-29 11:29:42 -07:00
context-bridge.md feat: context bridge support VideoFrame (#47316) 2025-08-07 16:41:49 -04:00
cookies.md feat: introduce os_crypt_async in safeStorage (#49054) 2026-02-15 19:54:50 +01:00
corner-smoothing-css.md docs: fix typos across documentation (#49734) 2026-02-11 12:45:46 +01:00
crash-reporter.md docs: add more api history (C-D) (#49510) 2026-03-05 11:30:20 +01:00
debugger.md docs: remove stale example and standardize DevTools capitalization (#49321) 2026-01-14 10:35:53 +01:00
desktop-capturer.md docs: cleanup desktop-capturer doc after chromium audio capture additions (#50091) 2026-03-06 15:27:00 -05:00
dialog.md docs: add more api history (C-D) (#49510) 2026-03-05 11:30:20 +01:00
dock.md docs: add Menu module tutorials (#47268) 2025-07-15 15:09:32 -07:00
download-item.md chore: lint code blocks in docs with ESLint (#42113) 2025-05-29 12:45:26 -07:00
environment-variables.md feat: msix auto-updater (#49230) 2026-01-29 16:38:26 -05:00
extensions-api.md docs: remove stale example and standardize DevTools capitalization (#49321) 2026-01-14 10:35:53 +01:00
extensions.md docs: unify [!NOTE] structure (#46893) 2025-05-09 14:36:42 -07:00
global-shortcut.md feat: add setSuspended and isSuspended to globalShortcut (#50777) 2026-04-08 11:05:39 -07:00
image-view.md docs: add API history (G-I) (#50194) 2026-03-12 14:43:39 +01:00
in-app-purchase.md docs: add API history (G-I) (#50194) 2026-03-12 14:43:39 +01:00
incoming-message.md docs: fix typos across documentation (#49734) 2026-02-11 12:45:46 +01:00
ipc-main-service-worker.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
ipc-main.md docs: add API history (G-I) (#50194) 2026-03-12 14:43:39 +01:00
ipc-renderer.md docs: add API history (G-I) (#50194) 2026-03-12 14:43:39 +01:00
menu-item.md docs: link menu type references (#50751) 2026-04-06 17:27:38 -04:00
menu.md fix: move Electron help menu links to default app only (#50861) 2026-04-09 22:36:32 +00:00
message-channel-main.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
message-port-main.md docs: fix broken links (#36519) 2022-12-05 13:18:57 -05:00
native-image.md docs: explain how to load SF Symbols with nativeImage (#48908) 2025-11-13 10:41:00 -05:00
native-theme.md feat: add accessibilityDisplayShouldDifferentiateWithoutColor on macOS (#50409) 2026-03-25 15:50:57 -04:00
navigation-history.md docs: clarify navigationhistory offsets (#45616) 2025-02-21 17:35:17 -06:00
net-log.md docs: unify [!NOTE] structure (#46893) 2025-05-09 14:36:42 -07:00
net.md chore: lint code blocks in docs with ESLint (#42113) 2025-05-29 12:45:26 -07:00
notification.md feat: add Notification.getHistory() for macOS (#51123) 2026-04-22 11:25:24 -07:00
parent-port.md docs: fix broken links (#36519) 2022-12-05 13:18:57 -05:00
power-monitor.md docs: fix powerMonitor event types (#45518) 2025-02-10 10:13:11 -05:00
power-save-blocker.md docs: unify [!NOTE] structure (#46893) 2025-05-09 14:36:42 -07:00
process.md docs: fix typos across documentation (#49734) 2026-02-11 12:45:46 +01:00
protocol.md docs: clarify allowed characters in protocol names (#50537) 2026-03-27 09:58:18 -04:00
push-notifications.md fix: APNS token ids are lowercase ASCII (#46101) 2025-03-20 07:57:50 +01:00
safe-storage.md feat: introduce os_crypt_async in safeStorage (#49054) 2026-02-15 19:54:50 +01:00
screen.md fix: screen.getCursorScreenPoint() crash on Wayland (#50092) 2026-03-06 15:24:33 -05:00
service-worker-main.md docs: fix some module headings (#48177) 2025-08-27 14:52:26 -07:00
service-workers.md chore: lint code blocks in docs with ESLint (#42113) 2025-05-29 12:45:26 -07:00
session.md feat: support WebAuthn Touch ID platform authenticator on macOS (#51411) 2026-05-01 11:15:13 -04:00
share-menu.md docs: add a few API history fragments (#49340) 2026-01-21 12:57:02 -05:00
shared-texture.md chore: use relative links from docs/ to files outside of docs/ (#49605) 2026-02-19 01:15:27 -08:00
shell.md docs: document that shell.trashItem requires backslashes (#49038) 2026-01-21 13:21:01 -05:00
system-preferences.md feat: Add getAccentColor on Linux (#48027) 2025-10-21 14:26:30 -04:00
touch-bar-button.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-color-picker.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-group.md fix: ensure the typescript definitions only export correct value types (#28712) 2021-06-15 13:50:31 -07:00
touch-bar-label.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-other-items-proxy.md docs: unify [!NOTE] structure (#46893) 2025-05-09 14:36:42 -07:00
touch-bar-popover.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-scrubber.md fix: documentation spelling errors (#43366) 2024-08-22 15:44:55 +02:00
touch-bar-segmented-control.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-slider.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar-spacer.md docs: type names changed from wrapper to primitive (#31752) 2021-11-15 22:13:18 -06:00
touch-bar.md docs: remove documentation link to discontinued Touch Bar Simulator (#49899) 2026-02-23 15:04:31 -05:00
tray.md feat: allow macOS tray to maintain position (#47838) 2025-08-07 19:25:50 +02:00
utility-process.md feat: add support for disclaiming utility processes (#49128) 2026-02-05 14:37:24 -08:00
view.md feat: Allow View.setBounds to animate (#48812) 2026-01-30 15:18:56 -05:00
web-contents-view.md docs: no class inheritance (#47403) 2025-06-10 10:00:06 +02:00
web-contents.md docs: add further disposition description (#51368) 2026-04-28 11:15:00 -05:00
web-frame-main.md feat: webFrameMain.fromFrameToken (#47850) 2025-07-31 16:41:44 -04:00
web-frame.md docs: remove stale example and standardize DevTools capitalization (#49321) 2026-01-14 10:35:53 +01:00
web-request.md feat: add excludeUrls and modify urls in WebRequestFilter for better URL filtering (#44692) 2025-02-17 12:40:47 -08:00
web-utils.md docs: recommend calling renderer process modules from preload script (#48427) 2025-10-04 18:44:10 +02:00
webview-tag.md feat: allow defaulting to printer default page size (#49523) 2026-02-13 07:40:14 -05:00
window-open.md fix: restrict window.open features to allowlisted BrowserWindow options (#50949) 2026-04-11 08:54:21 -05:00