From bbf2c0a8ecb161765613fe9842c4f8330ec8388d Mon Sep 17 00:00:00 2001
From: jrandolf <101637635+jrandolf@users.noreply.github.com>
Date: Thu, 20 Apr 2023 08:18:48 +0200
Subject: [PATCH] chore: use AbortSignal instead of AbortController (#10048)
---
docs/api/puppeteer.waitforselectoroptions.md | 12 ++++++------
packages/puppeteer-core/src/common/IsolatedWorld.ts | 10 +++++-----
packages/puppeteer-core/src/common/QueryHandler.ts | 8 ++++----
packages/puppeteer-core/src/common/WaitTask.ts | 8 ++++----
test/src/waittask.spec.ts | 2 +-
5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/docs/api/puppeteer.waitforselectoroptions.md b/docs/api/puppeteer.waitforselectoroptions.md
index b8f3f3b3..41dbd25c 100644
--- a/docs/api/puppeteer.waitforselectoroptions.md
+++ b/docs/api/puppeteer.waitforselectoroptions.md
@@ -12,9 +12,9 @@ export interface WaitForSelectorOptions
## Properties
-| Property | Modifiers | Type | Description | Default |
-| --------------- | --------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- |
-| abortController | optional
| AbortController | Provide an abort controller to cancel a waitForSelector call. | |
-| hidden | optional
| boolean | Wait for the selected element to not be found in the DOM or to be hidden, i.e. have display: none
or visibility: hidden
CSS properties. | false
|
-| timeout | optional
| number |
Maximum time to wait in milliseconds. Pass 0
to disable timeout.
The default value can be changed by using [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md)
|30_000
(30 seconds) |
-| visible | optional
| boolean | Wait for the selected element to be present in DOM and to be visible, i.e. to not have display: none
or visibility: hidden
CSS properties. | false
|
+| Property | Modifiers | Type | Description | Default |
+| -------- | --------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- |
+| hidden | optional
| boolean | Wait for the selected element to not be found in the DOM or to be hidden, i.e. have display: none
or visibility: hidden
CSS properties. | false
|
+| signal | optional
| AbortSignal | A signal object that allows you to cancel a waitForSelector call. | |
+| timeout | optional
| number | Maximum time to wait in milliseconds. Pass 0
to disable timeout.
The default value can be changed by using [Page.setDefaultTimeout()](./puppeteer.page.setdefaulttimeout.md)
|30_000
(30 seconds) |
+| visible | optional
| boolean | Wait for the selected element to be present in DOM and to be visible, i.e. to not have display: none
or visibility: hidden
CSS properties. | false
|
diff --git a/packages/puppeteer-core/src/common/IsolatedWorld.ts b/packages/puppeteer-core/src/common/IsolatedWorld.ts
index 1e1e6450..7be1a856 100644
--- a/packages/puppeteer-core/src/common/IsolatedWorld.ts
+++ b/packages/puppeteer-core/src/common/IsolatedWorld.ts
@@ -73,9 +73,9 @@ export interface WaitForSelectorOptions {
*/
timeout?: number;
/**
- * Provide an abort controller to cancel a waitForSelector call.
+ * A signal object that allows you to cancel a waitForSelector call.
*/
- abortController?: AbortController;
+ signal?: AbortSignal;
}
/**
@@ -435,7 +435,7 @@ export class IsolatedWorld {
polling?: 'raf' | 'mutation' | number;
timeout?: number;
root?: ElementHandle