Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
726 changed files
with
17,463 additions
and
15,301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
<!-- docusaurus-metadata-start --> | ||
<!-- docusaurus-metadata-end --> | ||
|
||
# Puppeteer | ||
|
||
<!-- [START badges] --> | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
--- | ||
sidebar_label: Accessibility | ||
--- | ||
# Accessibility class | ||
|
||
The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access). | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare class Accessibility | ||
``` | ||
|
||
## Remarks | ||
|
||
Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output. | ||
|
||
Blink - Chrome's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree. | ||
|
||
Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Puppeteer tries to approximate this filtering, exposing only the "interesting" nodes of the tree. | ||
|
||
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Accessibility` class. | ||
|
||
## Methods | ||
|
||
| Method | Modifiers | Description | | ||
| --- | --- | --- | | ||
| [snapshot(options)](./puppeteer.accessibility.snapshot.md) | | Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. | | ||
|
||
--- | ||
sidebar_label: Accessibility | ||
--- | ||
|
||
# Accessibility class | ||
|
||
The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as [screen readers](https://en.wikipedia.org/wiki/Screen_reader) or [switches](https://en.wikipedia.org/wiki/Switch_access). | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare class Accessibility | ||
``` | ||
|
||
## Remarks | ||
|
||
Accessibility is a very platform-specific thing. On different platforms, there are different screen readers that might have wildly different output. | ||
|
||
Blink - Chrome's rendering engine - has a concept of "accessibility tree", which is then translated into different platform-specific APIs. Accessibility namespace gives users access to the Blink Accessibility Tree. | ||
|
||
Most of the accessibility tree gets filtered out when converting from Blink AX Tree to Platform-specific AX-Tree or by assistive technologies themselves. By default, Puppeteer tries to approximate this filtering, exposing only the "interesting" nodes of the tree. | ||
|
||
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Accessibility` class. | ||
|
||
## Methods | ||
|
||
| Method | Modifiers | Description | | ||
| ---------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------- | | ||
| [snapshot(options)](./puppeteer.accessibility.snapshot.md) | | Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,59 @@ | ||
--- | ||
sidebar_label: Accessibility.snapshot | ||
--- | ||
# Accessibility.snapshot() method | ||
|
||
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
class Accessibility {snapshot(options?: SnapshotOptions): Promise<SerializedAXNode | null>;} | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | <i>(Optional)</i> | | ||
|
||
**Returns:** | ||
|
||
Promise<[SerializedAXNode](./puppeteer.serializedaxnode.md) \| null> | ||
|
||
An AXNode object representing the snapshot. | ||
|
||
## Remarks | ||
|
||
\*\*NOTE\*\* The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Puppeteer will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`. | ||
|
||
## Example 1 | ||
|
||
An example of dumping the entire accessibility tree: | ||
|
||
```ts | ||
const snapshot = await page.accessibility.snapshot(); | ||
console.log(snapshot); | ||
``` | ||
|
||
## Example 2 | ||
|
||
An example of logging the focused node's name: | ||
|
||
```ts | ||
const snapshot = await page.accessibility.snapshot(); | ||
const node = findFocusedNode(snapshot); | ||
console.log(node && node.name); | ||
|
||
function findFocusedNode(node) { | ||
if (node.focused) | ||
return node; | ||
for (const child of node.children || []) { | ||
const foundNode = findFocusedNode(child); | ||
return foundNode; | ||
} | ||
return null; | ||
} | ||
``` | ||
|
||
--- | ||
sidebar_label: Accessibility.snapshot | ||
--- | ||
|
||
# Accessibility.snapshot() method | ||
|
||
Captures the current state of the accessibility tree. The returned object represents the root accessible node of the page. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
class Accessibility { | ||
snapshot(options?: SnapshotOptions): Promise<SerializedAXNode | null>; | ||
} | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --------- | ------------------------------------------------- | ----------------- | | ||
| options | [SnapshotOptions](./puppeteer.snapshotoptions.md) | <i>(Optional)</i> | | ||
|
||
**Returns:** | ||
|
||
Promise<[SerializedAXNode](./puppeteer.serializedaxnode.md) \| null> | ||
|
||
An AXNode object representing the snapshot. | ||
|
||
## Remarks | ||
|
||
\*\*NOTE\*\* The Chromium accessibility tree contains nodes that go unused on most platforms and by most screen readers. Puppeteer will discard them as well for an easier to process tree, unless `interestingOnly` is set to `false`. | ||
|
||
## Example 1 | ||
|
||
An example of dumping the entire accessibility tree: | ||
|
||
```ts | ||
const snapshot = await page.accessibility.snapshot(); | ||
console.log(snapshot); | ||
``` | ||
|
||
## Example 2 | ||
|
||
An example of logging the focused node's name: | ||
|
||
```ts | ||
const snapshot = await page.accessibility.snapshot(); | ||
const node = findFocusedNode(snapshot); | ||
console.log(node && node.name); | ||
|
||
function findFocusedNode(node) { | ||
if (node.focused) return node; | ||
for (const child of node.children || []) { | ||
const foundNode = findFocusedNode(child); | ||
return foundNode; | ||
} | ||
return null; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
--- | ||
sidebar_label: ActionResult | ||
--- | ||
# ActionResult type | ||
|
||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare type ActionResult = 'continue' | 'abort' | 'respond'; | ||
``` | ||
--- | ||
sidebar_label: ActionResult | ||
--- | ||
|
||
# ActionResult type | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare type ActionResult = 'continue' | 'abort' | 'respond'; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
--- | ||
sidebar_label: Awaitable | ||
--- | ||
# Awaitable type | ||
|
||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare type Awaitable<T> = T | PromiseLike<T>; | ||
``` | ||
--- | ||
sidebar_label: Awaitable | ||
--- | ||
|
||
# Awaitable type | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export declare type Awaitable<T> = T | PromiseLike<T>; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
--- | ||
sidebar_label: BoundingBox.height | ||
--- | ||
# BoundingBox.height property | ||
|
||
the height of the element in pixels. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface BoundingBox {height: number;} | ||
``` | ||
--- | ||
sidebar_label: BoundingBox.height | ||
--- | ||
|
||
# BoundingBox.height property | ||
|
||
the height of the element in pixels. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface BoundingBox { | ||
height: number; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
--- | ||
sidebar_label: BoundingBox | ||
--- | ||
# BoundingBox interface | ||
|
||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface BoundingBox extends Point | ||
``` | ||
**Extends:** [Point](./puppeteer.point.md) | ||
## Properties | ||
| Property | Modifiers | Type | Description | | ||
| --- | --- | --- | --- | | ||
| [height](./puppeteer.boundingbox.height.md) | | number | the height of the element in pixels. | | ||
| [width](./puppeteer.boundingbox.width.md) | | number | the width of the element in pixels. | | ||
--- | ||
sidebar_label: BoundingBox | ||
--- | ||
|
||
# BoundingBox interface | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
export interface BoundingBox extends Point | ||
``` | ||
**Extends:** [Point](./puppeteer.point.md) | ||
## Properties | ||
| Property | Modifiers | Type | Description | | ||
| ------------------------------------------- | --------- | ------ | ------------------------------------ | | ||
| [height](./puppeteer.boundingbox.height.md) | | number | the height of the element in pixels. | | ||
| [width](./puppeteer.boundingbox.width.md) | | number | the width of the element in pixels. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
--- | ||
sidebar_label: BoundingBox.width | ||
--- | ||
# BoundingBox.width property | ||
|
||
the width of the element in pixels. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface BoundingBox {width: number;} | ||
``` | ||
--- | ||
sidebar_label: BoundingBox.width | ||
--- | ||
|
||
# BoundingBox.width property | ||
|
||
the width of the element in pixels. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface BoundingBox { | ||
width: number; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
--- | ||
sidebar_label: BoxModel.border | ||
--- | ||
# BoxModel.border property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface BoxModel {border: Point[];} | ||
``` | ||
--- | ||
sidebar_label: BoxModel.border | ||
--- | ||
|
||
# BoxModel.border property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface BoxModel { | ||
border: Point[]; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
--- | ||
sidebar_label: BoxModel.content | ||
--- | ||
# BoxModel.content property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface BoxModel {content: Point[];} | ||
``` | ||
--- | ||
sidebar_label: BoxModel.content | ||
--- | ||
|
||
# BoxModel.content property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface BoxModel { | ||
content: Point[]; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
--- | ||
sidebar_label: BoxModel.height | ||
--- | ||
# BoxModel.height property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface BoxModel {height: number;} | ||
``` | ||
--- | ||
sidebar_label: BoxModel.height | ||
--- | ||
|
||
# BoxModel.height property | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
interface BoxModel { | ||
height: number; | ||
} | ||
``` |
Oops, something went wrong.