Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: merge Puppeteer and PuppeteerNode #12291

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
8 changes: 6 additions & 2 deletions docs/api/puppeteer.defaultargs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ sidebar_label: defaultArgs
#### Signature:

```typescript
defaultArgs: (options?: import("puppeteer-core/internal/puppeteer-core.js").BrowserLaunchArgumentOptions | undefined) => string[]
defaultArgs: (
options?:
| import('puppeteer-core/internal/puppeteer-core.js').BrowserLaunchArgumentOptions
| undefined
) => Promise<string[]>;
```

## Parameters
Expand Down Expand Up @@ -41,4 +45,4 @@ _(Optional)_
</tbody></table>
**Returns:**

string\[\]
Promise&lt;string\[\]&gt;
4 changes: 2 additions & 2 deletions docs/api/puppeteer.executablepath.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ executablePath: (
channel?:
| import('puppeteer-core/internal/puppeteer-core.js').ChromeReleaseChannel
| undefined
) => string;
) => Promise<string>;
```

## Parameters
Expand Down Expand Up @@ -45,4 +45,4 @@ _(Optional)_
</tbody></table>
**Returns:**

string
Promise&lt;string&gt;
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,14 +1,14 @@
---
sidebar_label: PuppeteerNode.defaultArgs
sidebar_label: Puppeteer.defaultArgs
---

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

#### Signature:

```typescript
class PuppeteerNode {
defaultArgs(options?: BrowserLaunchArgumentOptions): string[];
class Puppeteer {
defaultArgs(options?: BrowserLaunchArgumentOptions): Promise<string[]>;
}
```

Expand Down Expand Up @@ -43,6 +43,6 @@ _(Optional)_ Set of configurable options to set on the browser.
</tbody></table>
**Returns:**

string\[\]
Promise&lt;string\[\]&gt;

The default flags that Chromium will be launched with.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
sidebar_label: PuppeteerNode.executablePath
sidebar_label: Puppeteer.executablePath
---

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

The default executable path.

#### Signature:

```typescript
class PuppeteerNode {
executablePath(channel?: ChromeReleaseChannel): string;
class Puppeteer {
executablePath(channel?: ChromeReleaseChannel): Promise<string>;
}
```

Expand Down Expand Up @@ -45,4 +45,4 @@ _(Optional)_
</tbody></table>
**Returns:**

string
Promise&lt;string&gt;
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.