diff --git a/docs/src/api/class-apirequestcontext.md b/docs/src/api/class-apirequestcontext.md index 2ddc3815f6b18..28399a0b031b8 100644 --- a/docs/src/api/class-apirequestcontext.md +++ b/docs/src/api/class-apirequestcontext.md @@ -184,6 +184,8 @@ context cookies from the response. The method will automatically follow redirect ### option: APIRequestContext.delete.timeout = %%-js-python-csharp-fetch-option-timeout-%% * since: v1.16 +### option: APIRequestContext.delete.signal = %%-input-signal-%% + ### option: APIRequestContext.delete.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%% * since: v1.16 @@ -361,6 +363,8 @@ If set changes the fetch method (e.g. [PUT](https://developer.mozilla.org/en-US/ ### option: APIRequestContext.fetch.timeout = %%-js-python-csharp-fetch-option-timeout-%% * since: v1.16 +### option: APIRequestContext.fetch.signal = %%-input-signal-%% + ### option: APIRequestContext.fetch.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%% * since: v1.16 @@ -474,6 +478,8 @@ await request.GetAsync("https://example.com/api/getText", new() { Params = query ### option: APIRequestContext.get.timeout = %%-js-python-csharp-fetch-option-timeout-%% * since: v1.16 +### option: APIRequestContext.get.signal = %%-input-signal-%% + ### option: APIRequestContext.get.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%% * since: v1.16 @@ -539,6 +545,8 @@ context cookies from the response. The method will automatically follow redirect ### option: APIRequestContext.head.timeout = %%-js-python-csharp-fetch-option-timeout-%% * since: v1.16 +### option: APIRequestContext.head.signal = %%-input-signal-%% + ### option: APIRequestContext.head.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%% * since: v1.16 @@ -604,6 +612,8 @@ context cookies from the response. The method will automatically follow redirect ### option: APIRequestContext.patch.timeout = %%-js-python-csharp-fetch-option-timeout-%% * since: v1.16 +### option: APIRequestContext.patch.signal = %%-input-signal-%% + ### option: APIRequestContext.patch.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%% * since: v1.16 @@ -790,6 +800,8 @@ await request.PostAsync("https://example.com/api/uploadScript", new() { Multipar ### option: APIRequestContext.post.timeout = %%-js-python-csharp-fetch-option-timeout-%% * since: v1.16 +### option: APIRequestContext.post.signal = %%-input-signal-%% + ### option: APIRequestContext.post.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%% * since: v1.16 @@ -855,6 +867,8 @@ context cookies from the response. The method will automatically follow redirect ### option: APIRequestContext.put.timeout = %%-js-python-csharp-fetch-option-timeout-%% * since: v1.16 +### option: APIRequestContext.put.signal = %%-input-signal-%% + ### option: APIRequestContext.put.failOnStatusCode = %%-js-python-csharp-fetch-option-failonstatuscode-%% * since: v1.16 diff --git a/docs/src/api/class-locator.md b/docs/src/api/class-locator.md index 3cb294302d111..bba1f1f9a699a 100644 --- a/docs/src/api/class-locator.md +++ b/docs/src/api/class-locator.md @@ -1137,6 +1137,8 @@ Maximum time in milliseconds to wait for the locator before evaluating. Note tha Maximum time in milliseconds to wait for the locator before evaluating. Note that after locator is resolved, evaluation itself is not limited by the timeout. Defaults to `0` - no timeout. +### option: Locator.evaluate.signal = %%-input-signal-%% + ## async method: Locator.evaluateAll * since: v1.14 - returns: <[Serializable]> @@ -1234,6 +1236,8 @@ Maximum time in milliseconds to wait for the locator before evaluating. Note tha Maximum time in milliseconds to wait for the locator before evaluating. Note that after locator is resolved, evaluation itself is not limited by the timeout. Defaults to `0` - no timeout. +### option: Locator.evaluateHandle.signal = %%-input-signal-%% + ## async method: Locator.fill * since: v1.14 diff --git a/docs/src/api/class-route.md b/docs/src/api/class-route.md index 5bbe4b3f8374b..ccccbe556c71a 100644 --- a/docs/src/api/class-route.md +++ b/docs/src/api/class-route.md @@ -528,6 +528,8 @@ Maximum number of times network errors should be retried. Currently only `ECONNR Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. +### option: Route.fetch.signal = %%-input-signal-%% + ### option: Route.fetch.method * since: v1.29 - `method` <[string]> diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.ts index 9df5611d2ab15..509e7b0750d94 100644 --- a/packages/playwright-client/types/types.d.ts +++ b/packages/playwright-client/types/types.d.ts @@ -13844,7 +13844,7 @@ export interface Locator { * [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-evaluate-option-expression). * @param options */ - evaluate(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number }): Promise; + evaluate(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise; /** * Execute JavaScript code in the page, taking the matching element as an argument, and return a * [JSHandle](https://playwright.dev/docs/api/class-jshandle) with the result. @@ -13877,7 +13877,7 @@ export interface Locator { * [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-evaluate-handle-option-expression). * @param options */ - evaluateHandle(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number }): Promise>; + evaluateHandle(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise>; /** * Execute JavaScript code in the page, taking all matching elements as an argument. * @@ -19038,6 +19038,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19175,6 +19186,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19287,6 +19309,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19373,6 +19406,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19459,6 +19503,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19587,6 +19642,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19673,6 +19739,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -22388,6 +22465,17 @@ export interface Route { */ postData?: string|Buffer|Serializable; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ diff --git a/packages/playwright-core/src/client/fetch.ts b/packages/playwright-core/src/client/fetch.ts index 6439951aa475d..59a729ae636ee 100644 --- a/packages/playwright-core/src/client/fetch.ts +++ b/packages/playwright-core/src/client/fetch.ts @@ -44,6 +44,7 @@ export type FetchOptions = { form?: { [key: string]: string|number|boolean; } | FormData; multipart?: { [key: string]: string|number|boolean|fs.ReadStream|FilePayload; } | FormData; timeout?: number, + signal?: AbortSignal, failOnStatusCode?: boolean, ignoreHTTPSErrors?: boolean, maxRedirects?: number, @@ -260,7 +261,7 @@ export class APIRequestContext extends ChannelOwner(pageFunction: structs.PageFunctionOn, arg?: Arg, options?: TimeoutOptions): Promise { - return await this._withElement(h => h.evaluate(pageFunction, arg), { title: 'Evaluate', timeout: options?.timeout }); + return await this._withElement(h => h.evaluate(pageFunction, arg), { title: 'Evaluate', timeout: options?.timeout, signal: options?.signal }); } async evaluateAll(pageFunction: structs.PageFunctionOn, arg?: Arg): Promise { @@ -142,7 +142,7 @@ export class Locator implements api.Locator { } async evaluateHandle(pageFunction: structs.PageFunctionOn, arg?: Arg, options?: TimeoutOptions): Promise> { - return await this._withElement(h => h.evaluateHandle(pageFunction, arg), { title: 'Evaluate', timeout: options?.timeout }); + return await this._withElement(h => h.evaluateHandle(pageFunction, arg), { title: 'Evaluate', timeout: options?.timeout, signal: options?.signal }); } async fill(value: string, options: channels.ElementHandleFillOptions & TimeoutOptions = {}): Promise { diff --git a/packages/playwright-core/src/client/network.ts b/packages/playwright-core/src/client/network.ts index e1efd766913c6..6986160ee7aa2 100644 --- a/packages/playwright-core/src/client/network.ts +++ b/packages/playwright-core/src/client/network.ts @@ -346,7 +346,7 @@ export class Route extends ChannelOwner implements api.Ro }); } - async fetch(options: FallbackOverrides & { maxRedirects?: number, maxRetries?: number, timeout?: number } = {}): Promise { + async fetch(options: FallbackOverrides & { maxRedirects?: number, maxRetries?: number, timeout?: number, signal?: AbortSignal } = {}): Promise { return await this._wrapApiCall(async () => { return await this._context.request._innerFetch({ request: this.request(), data: options.postData, ...options }); }); diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index 9df5611d2ab15..509e7b0750d94 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -13844,7 +13844,7 @@ export interface Locator { * [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-evaluate-option-expression). * @param options */ - evaluate(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number }): Promise; + evaluate(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise; /** * Execute JavaScript code in the page, taking the matching element as an argument, and return a * [JSHandle](https://playwright.dev/docs/api/class-jshandle) with the result. @@ -13877,7 +13877,7 @@ export interface Locator { * [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-evaluate-handle-option-expression). * @param options */ - evaluateHandle(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number }): Promise>; + evaluateHandle(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise>; /** * Execute JavaScript code in the page, taking all matching elements as an argument. * @@ -19038,6 +19038,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19175,6 +19186,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19287,6 +19309,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19373,6 +19406,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19459,6 +19503,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19587,6 +19642,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -19673,6 +19739,17 @@ export interface APIRequestContext { */ params?: { [key: string]: string|number|boolean; }|URLSearchParams|string; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ @@ -22388,6 +22465,17 @@ export interface Route { */ postData?: string|Buffer|Serializable; + /** + * Allows to cancel the operation using an + * [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). If the signal is aborted, the + * operation will be aborted and throw an error. Note that providing a signal does not disable the default timeout, + * which can be changed using + * [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) + * or [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout); pass + * `timeout: 0` to disable the timeout entirely. + */ + signal?: AbortSignal; + /** * Request timeout in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. */ diff --git a/utils/generate_types/overrides.d.ts b/utils/generate_types/overrides.d.ts index 54300f3c1e90b..302fd7e31294e 100644 --- a/utils/generate_types/overrides.d.ts +++ b/utils/generate_types/overrides.d.ts @@ -190,8 +190,8 @@ export interface ElementHandle extends JSHandle { } export interface Locator { - evaluate(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number }): Promise; - evaluateHandle(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number }): Promise>; + evaluate(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise; + evaluateHandle(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise>; evaluateAll(pageFunction: PageFunctionOn, arg?: Arg): Promise; waitForFunction(pageFunction: PageFunctionOn, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise; elementHandle(options?: { timeout?: number }): Promise>;