Skip to content

Commit

Permalink
refactor: merge Puppeteer and PuppeteerNode
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Apr 18, 2024
1 parent ef8c4c8 commit cf9d1fc
Show file tree
Hide file tree
Showing 31 changed files with 139 additions and 491 deletions.
26 changes: 2 additions & 24 deletions docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The Accessibility class provides methods for inspecting the browser's accessibil

[Browser](./puppeteer.browser.md) represents a browser instance that is either:

- connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md) or - launched by [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md).
- connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md) or - launched by [Puppeteer.launch()](./puppeteer.puppeteer.launch.md).

[Browser](./puppeteer.browser.md) [emits](./puppeteer.eventemitter.emit.md) various events which are documented in the [BrowserEvent](./puppeteer.browserevent.md) enum.

Expand Down Expand Up @@ -262,9 +262,7 @@ ProtocolError is emitted whenever there is an error from the protocol.

</td><td>

The main Puppeteer class.

IMPORTANT: if you are using Puppeteer in a Node environment, you will get an instance of [PuppeteerNode](./puppeteer.puppeteernode.md) when you import or require `puppeteer`. That class extends `Puppeteer`, so has all the methods documented below as well as all that are defined on [PuppeteerNode](./puppeteer.puppeteernode.md).
The main [Puppeteer](./puppeteer.puppeteer.md) class with Node specific behaviour for fetching and downloading browsers.

</td></tr>
<tr><td>
Expand All @@ -278,17 +276,6 @@ The base class for all Puppeteer-specific errors
</td></tr>
<tr><td>

<span id="puppeteernode">[PuppeteerNode](./puppeteer.puppeteernode.md)</span>

</td><td>

Extends the main [Puppeteer](./puppeteer.puppeteer.md) class with Node specific behaviour for fetching and downloading browsers.

If you're using Puppeteer in a Node environment, this is the class you'll get when you run `require('puppeteer')` (or the equivalent ES `import`).

</td></tr>
<tr><td>

<span id="screenrecorder">[ScreenRecorder](./puppeteer.screenrecorder.md)</span>

</td><td>
Expand Down Expand Up @@ -1436,15 +1423,6 @@ Supported products.
</td></tr>
<tr><td>

<span id="puppeteernodelaunchoptions">[PuppeteerNodeLaunchOptions](./puppeteer.puppeteernodelaunchoptions.md)</span>

</td><td>

Utility type exposed to enable users to define options that can be passed to `puppeteer.launch` without having to list the set of all types.

</td></tr>
<tr><td>

<span id="quad">[Quad](./puppeteer.quad.md)</span>

</td><td>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_label: Browser

[Browser](./puppeteer.browser.md) represents a browser instance that is either:

- connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md) or - launched by [PuppeteerNode.launch()](./puppeteer.puppeteernode.launch.md).
- connected to via [Puppeteer.connect()](./puppeteer.puppeteer.connect.md) or - launched by [Puppeteer.launch()](./puppeteer.puppeteer.launch.md).

[Browser](./puppeteer.browser.md) [emits](./puppeteer.eventemitter.emit.md) various events which are documented in the [BrowserEvent](./puppeteer.browserevent.md) enum.

Expand Down
4 changes: 2 additions & 2 deletions docs/api/puppeteer.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Specifies a certain version of the browser you'd like Puppeteer to use.

Can be overridden by `PUPPETEER_BROWSER_REVISION`.

See [puppeteer.launch](./puppeteer.puppeteernode.launch.md) on how executable path is inferred.
See [puppeteer.launch](./puppeteer.puppeteer.launch.md) on how executable path is inferred.

Use a specific browser version (e.g., 119.0.6045.105). If you use an alias such `stable` or `canary` it will only work during the installation of Puppeteer and it will fail when launching the browser.

Expand Down Expand Up @@ -147,7 +147,7 @@ string

</td><td>

Specifies an executable path to be used in [puppeteer.launch](./puppeteer.puppeteernode.launch.md).
Specifies an executable path to be used in [puppeteer.launch](./puppeteer.puppeteer.launch.md).

Can be overridden by `PUPPETEER_EXECUTABLE_PATH`.

Expand Down
4 changes: 2 additions & 2 deletions docs/api/puppeteer.productlauncher.launch.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_label: ProductLauncher.launch

```typescript
class ProductLauncher {
launch(options?: PuppeteerNodeLaunchOptions): Promise<Browser>;
launch(options?: PuppeteerLaunchOptions): Promise<Browser>;
}
```

Expand All @@ -33,7 +33,7 @@ options

</td><td>

[PuppeteerNodeLaunchOptions](./puppeteer.puppeteernodelaunchoptions.md)
[PuppeteerLaunchOptions](./puppeteer.puppeteerlaunchoptions.md)

</td><td>

Expand Down
2 changes: 0 additions & 2 deletions docs/api/puppeteer.puppeteer.connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ Set of configurable options to set on the browser.
Promise&lt;[Browser](./puppeteer.browser.md)&gt;

Promise which resolves to browser instance.

## Remarks
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
sidebar_label: PuppeteerNode.defaultArgs
sidebar_label: Puppeteer.defaultArgs
---

# PuppeteerNode.defaultArgs() method
# Puppeteer.defaultArgs() method

#### Signature:

```typescript
class PuppeteerNode {
class Puppeteer {
defaultArgs(options?: BrowserLaunchArgumentOptions): string[];
}
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
sidebar_label: PuppeteerNode.executablePath
sidebar_label: Puppeteer.executablePath
---

# PuppeteerNode.executablePath() method
# Puppeteer.executablePath() method

The default executable path.

#### Signature:

```typescript
class PuppeteerNode {
class Puppeteer {
executablePath(channel?: ChromeReleaseChannel): string;
}
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
sidebar_label: PuppeteerNode.launch
sidebar_label: Puppeteer.launch
---

# PuppeteerNode.launch() method
# Puppeteer.launch() method

Launches a browser instance with given arguments and options when specified.

Expand All @@ -11,7 +11,7 @@ When using with `puppeteer-core`, [options.executablePath](./puppeteer.launchopt
#### Signature:

```typescript
class PuppeteerNode {
class Puppeteer {
launch(options?: PuppeteerLaunchOptions): Promise<Browser>;
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.puppeteer.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ sidebar_label: puppeteer
#### Signature:

```typescript
puppeteer: PuppeteerNode;
puppeteer: Puppeteer;
```
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
sidebar_label: PuppeteerNode.trimCache
sidebar_label: Puppeteer.trimCache
---

# PuppeteerNode.trimCache() method
# Puppeteer.trimCache() method

Removes all non-current Firefox and Chrome binaries in the cache directory identified by the provided Puppeteer configuration. The current browser version is determined by resolving PUPPETEER_REVISIONS from Puppeteer unless `configuration.browserRevision` is provided.

#### Signature:

```typescript
class PuppeteerNode {
class Puppeteer {
trimCache(): Promise<void>;
}
```
Expand Down
50 changes: 0 additions & 50 deletions docs/api/puppeteer.puppeteernode.connect.md

This file was deleted.

0 comments on commit cf9d1fc

Please sign in to comment.