From 07a7b5c3d5ce7e987ecc43d5b3094014bf7f7ab6 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 18 Jun 2026 12:15:09 +0200 Subject: [PATCH 1/2] feat(core): support cancelling channel calls via AbortSignal Threads an AbortSignal through the client as a required second argument on channel methods (mirroring progress on the dispatcher side), so server-side calls can be cancelled. --- docs/src/api/class-elementhandle.md | 34 + docs/src/api/class-filechooser.md | 2 + docs/src/api/class-frame.md | 56 + docs/src/api/class-locator.md | 70 + docs/src/api/class-page.md | 66 + docs/src/api/params.md | 10 +- packages/isomorphic/platform.ts | 8 +- packages/playwright-client/types/types.d.ts | 1253 ++++++++++++++++- .../playwright-core/src/client/android.ts | 54 +- .../playwright-core/src/client/artifact.ts | 14 +- .../playwright-core/src/client/browser.ts | 16 +- .../src/client/browserContext.ts | 50 +- .../playwright-core/src/client/browserType.ts | 8 +- .../playwright-core/src/client/cdpSession.ts | 4 +- .../src/client/channelOwner.ts | 6 +- .../playwright-core/src/client/channels.d.ts | 634 ++++----- packages/playwright-core/src/client/clock.ts | 14 +- .../playwright-core/src/client/connect.ts | 6 +- .../playwright-core/src/client/connection.ts | 22 +- .../playwright-core/src/client/coverage.ts | 8 +- .../playwright-core/src/client/credentials.ts | 8 +- .../playwright-core/src/client/debugger.ts | 8 +- packages/playwright-core/src/client/dialog.ts | 4 +- .../playwright-core/src/client/disposable.ts | 2 +- .../playwright-core/src/client/electron.ts | 8 +- .../src/client/elementHandle.ts | 74 +- packages/playwright-core/src/client/fetch.ts | 14 +- packages/playwright-core/src/client/frame.ts | 96 +- packages/playwright-core/src/client/input.ts | 22 +- .../playwright-core/src/client/jsHandle.ts | 12 +- .../playwright-core/src/client/localUtils.ts | 16 +- .../playwright-core/src/client/locator.ts | 24 +- .../playwright-core/src/client/network.ts | 50 +- packages/playwright-core/src/client/page.ts | 68 +- .../playwright-core/src/client/screencast.ts | 20 +- .../playwright-core/src/client/selectors.ts | 4 +- .../playwright-core/src/client/tracing.ts | 24 +- .../playwright-core/src/client/webStorage.ts | 10 +- packages/playwright-core/src/client/worker.ts | 6 +- .../src/server/dispatchers/dispatcher.ts | 12 +- .../src/server/socksInterceptor.ts | 10 +- packages/playwright-core/types/types.d.ts | 1253 ++++++++++++++++- packages/playwright/src/matchers/matchers.ts | 68 +- .../src/matchers/toMatchAriaSnapshot.ts | 4 +- packages/utils/nodePlatform.ts | 8 +- tests/config/debugControllerBackend.ts | 2 +- tests/library/debug-controller.spec.ts | 32 +- tests/page/page-click.spec.ts | 15 + utils/generate_channels.js | 3 +- 49 files changed, 3478 insertions(+), 734 deletions(-) diff --git a/docs/src/api/class-elementhandle.md b/docs/src/api/class-elementhandle.md index 47f622a536655..d677003dd8862 100644 --- a/docs/src/api/class-elementhandle.md +++ b/docs/src/api/class-elementhandle.md @@ -188,6 +188,8 @@ When all steps combined have not finished during the specified [`option: timeout ### option: ElementHandle.check.timeout = %%-input-timeout-js-%% * since: v1.8 +### option: ElementHandle.check.signal = %%-input-signal-%% + ### option: ElementHandle.check.trial = %%-input-trial-%% * since: v1.11 @@ -233,6 +235,8 @@ When all steps combined have not finished during the specified [`option: timeout ### option: ElementHandle.click.timeout = %%-input-timeout-js-%% * since: v1.8 +### option: ElementHandle.click.signal = %%-input-signal-%% + ### option: ElementHandle.click.trial = %%-input-trial-%% * since: v1.11 @@ -289,6 +293,8 @@ When all steps combined have not finished during the specified [`option: timeout ### option: ElementHandle.dblclick.timeout = %%-input-timeout-js-%% * since: v1.8 +### option: ElementHandle.dblclick.signal = %%-input-signal-%% + ### option: ElementHandle.dblclick.trial = %%-input-trial-%% * since: v1.11 @@ -551,6 +557,8 @@ Value to set for the ``, `