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

feat: use configuration files #9140

Merged
merged 1 commit into from Oct 21, 2022
Merged
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
3 changes: 2 additions & 1 deletion docs/api/index.md
Expand Up @@ -30,6 +30,7 @@ sidebar_label: API
| [Keyboard](./puppeteer.keyboard.md) | Keyboard provides an api for managing a virtual keyboard. The high level api is [Keyboard.type()](./puppeteer.keyboard.type.md), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page. |
| [Mouse](./puppeteer.mouse.md) | The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport. |
| [Page](./puppeteer.page.md) | <p>Page provides methods to interact with a single tab or [extension background page](https://developer.chrome.com/extensions/background_pages) in Chromium.</p><p>:::note</p><p>One Browser instance might have multiple Page instances.</p><p>:::</p> |
| [ProductLauncher](./puppeteer.productlauncher.md) | Describes a launcher - a class that is able to create and launch a browser instance. |
| [ProtocolError](./puppeteer.protocolerror.md) | ProtocolError is emitted whenever there is an error from the protocol. |
| [Puppeteer](./puppeteer.puppeteer.md) | <p>The main Puppeteer class.</p><p>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 <code>puppeteer</code>. That class extends <code>Puppeteer</code>, so has all the methods documented below as well as all that are defined on [PuppeteerNode](./puppeteer.puppeteernode.md).</p> |
| [PuppeteerNode](./puppeteer.puppeteernode.md) | <p>Extends the main [Puppeteer](./puppeteer.puppeteer.md) class with Node specific behaviour for fetching and downloading browsers.</p><p>If you're using Puppeteer in a Node environment, this is the class you'll get when you run <code>require('puppeteer')</code> (or the equivalent ES <code>import</code>).</p> |
Expand Down Expand Up @@ -72,6 +73,7 @@ sidebar_label: API
| [CDPSessionOnMessageObject](./puppeteer.cdpsessiononmessageobject.md) | |
| [ClickOptions](./puppeteer.clickoptions.md) | |
| [CommonEventEmitter](./puppeteer.commoneventemitter.md) | |
| [Configuration](./puppeteer.configuration.md) | |
| [ConnectionCallback](./puppeteer.connectioncallback.md) | |
| [ConnectionTransport](./puppeteer.connectiontransport.md) | |
| [ConnectOptions](./puppeteer.connectoptions.md) | |
Expand Down Expand Up @@ -102,7 +104,6 @@ sidebar_label: API
| [PDFOptions](./puppeteer.pdfoptions.md) | Valid options to configure PDF generation via [Page.pdf()](./puppeteer.page.pdf.md). |
| [Point](./puppeteer.point.md) | |
| [PressOptions](./puppeteer.pressoptions.md) | |
| [ProductLauncher](./puppeteer.productlauncher.md) | Describes a launcher - a class that is able to create and launch a browser instance. |
| [PuppeteerErrors](./puppeteer.puppeteererrors.md) | |
| [PuppeteerLaunchOptions](./puppeteer.puppeteerlaunchoptions.md) | |
| [RemoteAddress](./puppeteer.remoteaddress.md) | |
Expand Down
8 changes: 4 additions & 4 deletions docs/api/puppeteer.browserfetcher._constructor_.md
Expand Up @@ -10,12 +10,12 @@ Constructs a browser fetcher for the given options.

```typescript
class BrowserFetcher {
constructor(options?: BrowserFetcherOptions);
constructor(options: BrowserFetcherOptions);
}
```

## Parameters

| Parameter | Type | Description |
| --------- | ------------------------------------------------------------- | ----------------- |
| options | [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) | <i>(Optional)</i> |
| Parameter | Type | Description |
| --------- | ------------------------------------------------------------- | ----------- |
| options | [BrowserFetcherOptions](./puppeteer.browserfetcheroptions.md) | |
6 changes: 3 additions & 3 deletions docs/api/puppeteer.browserfetcher.localrevisions.md
Expand Up @@ -8,15 +8,15 @@ sidebar_label: BrowserFetcher.localRevisions

```typescript
class BrowserFetcher {
localRevisions(): Promise<string[]>;
localRevisions(): string[];
}
```

**Returns:**

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

A promise with a list of all revision strings (for the current `product`) available locally on disk.
A list of all revision strings (for the current `product`) available locally on disk.

## Remarks

Expand Down
2 changes: 1 addition & 1 deletion docs/api/puppeteer.browserfetcher.md
Expand Up @@ -21,7 +21,7 @@ BrowserFetcher is not designed to work concurrently with other instances of Brow
An example of using BrowserFetcher to download a specific version of Chromium and running Puppeteer against it:

```ts
const browserFetcher = new BrowserFetcher();
const browserFetcher = new BrowserFetcher({path: 'path/to/download/folder'});
const revisionInfo = await browserFetcher.download('533271');
const browser = await puppeteer.launch({
executablePath: revisionInfo.executablePath,
Expand Down
13 changes: 7 additions & 6 deletions docs/api/puppeteer.browserfetcheroptions.md
Expand Up @@ -12,9 +12,10 @@ export interface BrowserFetcherOptions

## Properties

| Property | Modifiers | Type | Description |
| ---------------------------------------------------------- | --------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------ |
| [host?](./puppeteer.browserfetcheroptions.host.md) | | string | <i>(Optional)</i> Determines the host that will be used for downloading. |
| [path?](./puppeteer.browserfetcheroptions.path.md) | | string | <i>(Optional)</i> Determines the path to download browsers to. |
| [platform?](./puppeteer.browserfetcheroptions.platform.md) | | [Platform](./puppeteer.platform.md) | <i>(Optional)</i> Determines which platform the browser will be suited for. |
| [product?](./puppeteer.browserfetcheroptions.product.md) | | 'chrome' \| 'firefox' | <i>(Optional)</i> Determines which product the [BrowserFetcher](./puppeteer.browserfetcher.md) is for. |
| Property | Modifiers | Type | Description |
| ---------------------------------------------------------------------------- | --------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------ |
| [host?](./puppeteer.browserfetcheroptions.host.md) | | string | <i>(Optional)</i> Determines the host that will be used for downloading. |
| [path](./puppeteer.browserfetcheroptions.path.md) | | string | Determines the path to download browsers to. |
| [platform?](./puppeteer.browserfetcheroptions.platform.md) | | [Platform](./puppeteer.platform.md) | <i>(Optional)</i> Determines which platform the browser will be suited for. |
| [product?](./puppeteer.browserfetcheroptions.product.md) | | 'chrome' \| 'firefox' | <i>(Optional)</i> Determines which product the [BrowserFetcher](./puppeteer.browserfetcher.md) is for. |
| [useMacOSARMBinary?](./puppeteer.browserfetcheroptions.usemacosarmbinary.md) | | boolean | <i>(Optional)</i> Enables the use of the Chromium binary for macOS ARM. |
2 changes: 1 addition & 1 deletion docs/api/puppeteer.browserfetcheroptions.path.md
Expand Up @@ -10,6 +10,6 @@ Determines the path to download browsers to.

```typescript
interface BrowserFetcherOptions {
path?: string;
path: string;
}
```
15 changes: 15 additions & 0 deletions docs/api/puppeteer.browserfetcheroptions.usemacosarmbinary.md
@@ -0,0 +1,15 @@
---
sidebar_label: BrowserFetcherOptions.useMacOSARMBinary
---

# BrowserFetcherOptions.useMacOSARMBinary property

Enables the use of the Chromium binary for macOS ARM.

**Signature:**

```typescript
interface BrowserFetcherOptions {
useMacOSARMBinary?: boolean;
}
```
13 changes: 13 additions & 0 deletions docs/api/puppeteer.configuration.browserrevision.md
@@ -0,0 +1,13 @@
---
sidebar_label: Configuration.browserRevision
---

# Configuration.browserRevision property

**Signature:**

```typescript
interface Configuration {
browserRevision?: string;
}
```
13 changes: 13 additions & 0 deletions docs/api/puppeteer.configuration.cachedirectory.md
@@ -0,0 +1,13 @@
---
sidebar_label: Configuration.cacheDirectory
---

# Configuration.cacheDirectory property

**Signature:**

```typescript
interface Configuration {
cacheDirectory?: string;
}
```
13 changes: 13 additions & 0 deletions docs/api/puppeteer.configuration.defaultproduct.md
@@ -0,0 +1,13 @@
---
sidebar_label: Configuration.defaultProduct
---

# Configuration.defaultProduct property

**Signature:**

```typescript
interface Configuration {
defaultProduct?: Product;
}
```
13 changes: 13 additions & 0 deletions docs/api/puppeteer.configuration.downloadhost.md
@@ -0,0 +1,13 @@
---
sidebar_label: Configuration.downloadHost
---

# Configuration.downloadHost property

**Signature:**

```typescript
interface Configuration {
downloadHost?: string;
}
```
13 changes: 13 additions & 0 deletions docs/api/puppeteer.configuration.downloadpath.md
@@ -0,0 +1,13 @@
---
sidebar_label: Configuration.downloadPath
---

# Configuration.downloadPath property

**Signature:**

```typescript
interface Configuration {
downloadPath?: string;
}
```
13 changes: 13 additions & 0 deletions docs/api/puppeteer.configuration.executablepath.md
@@ -0,0 +1,13 @@
---
sidebar_label: Configuration.executablePath
---

# Configuration.executablePath property

**Signature:**

```typescript
interface Configuration {
executablePath?: string;
}
```
15 changes: 15 additions & 0 deletions docs/api/puppeteer.configuration.experiments.md
@@ -0,0 +1,15 @@
---
sidebar_label: Configuration.experiments
---

# Configuration.experiments property

**Signature:**

```typescript
interface Configuration {
experiments?: {
macArmChromiumEnabled?: boolean;
};
}
```
13 changes: 13 additions & 0 deletions docs/api/puppeteer.configuration.loglevel.md
@@ -0,0 +1,13 @@
---
sidebar_label: Configuration.logLevel
---

# Configuration.logLevel property

**Signature:**

```typescript
interface Configuration {
logLevel?: 'silent' | 'error' | 'warn';
}
```
26 changes: 26 additions & 0 deletions docs/api/puppeteer.configuration.md
@@ -0,0 +1,26 @@
---
sidebar_label: Configuration
---

# Configuration interface

**Signature:**

```typescript
export interface Configuration
```

## Properties

| Property | Modifiers | Type | Description |
| ---------------------------------------------------------------------- | --------- | ------------------------------------ | ----------------- |
| [browserRevision?](./puppeteer.configuration.browserrevision.md) | | string | <i>(Optional)</i> |
| [cacheDirectory?](./puppeteer.configuration.cachedirectory.md) | | string | <i>(Optional)</i> |
| [defaultProduct?](./puppeteer.configuration.defaultproduct.md) | | [Product](./puppeteer.product.md) | <i>(Optional)</i> |
| [downloadHost?](./puppeteer.configuration.downloadhost.md) | | string | <i>(Optional)</i> |
| [downloadPath?](./puppeteer.configuration.downloadpath.md) | | string | <i>(Optional)</i> |
| [executablePath?](./puppeteer.configuration.executablepath.md) | | string | <i>(Optional)</i> |
| [experiments?](./puppeteer.configuration.experiments.md) | | { macArmChromiumEnabled?: boolean; } | <i>(Optional)</i> |
| [logLevel?](./puppeteer.configuration.loglevel.md) | | 'silent' \| 'error' \| 'warn' | <i>(Optional)</i> |
| [skipDownload?](./puppeteer.configuration.skipdownload.md) | | boolean | <i>(Optional)</i> |
| [temporaryDirectory?](./puppeteer.configuration.temporarydirectory.md) | | string | <i>(Optional)</i> |
13 changes: 13 additions & 0 deletions docs/api/puppeteer.configuration.skipdownload.md
@@ -0,0 +1,13 @@
---
sidebar_label: Configuration.skipDownload
---

# Configuration.skipDownload property

**Signature:**

```typescript
interface Configuration {
skipDownload?: boolean;
}
```
13 changes: 13 additions & 0 deletions docs/api/puppeteer.configuration.temporarydirectory.md
@@ -0,0 +1,13 @@
---
sidebar_label: Configuration.temporaryDirectory
---

# Configuration.temporaryDirectory property

**Signature:**

```typescript
interface Configuration {
temporaryDirectory?: string;
}
```
2 changes: 1 addition & 1 deletion docs/api/puppeteer.connect.md
Expand Up @@ -9,5 +9,5 @@ sidebar_label: connect
```typescript
connect: (
options: import('puppeteer-core/internal/common/Puppeteer.js').ConnectOptions
) => Promise<import('./types').Browser>;
) => Promise<import('./types.js').Browser>;
```
4 changes: 3 additions & 1 deletion docs/api/puppeteer.createbrowserfetcher.md
Expand Up @@ -8,6 +8,8 @@ sidebar_label: createBrowserFetcher

```typescript
createBrowserFetcher: (
options: import('puppeteer-core/internal/node/BrowserFetcher.js').BrowserFetcherOptions
options: Partial<
import('puppeteer-core/internal/node/BrowserFetcher.js').BrowserFetcherOptions
>
) => import('puppeteer-core/internal/node/BrowserFetcher.js').BrowserFetcher;
```
6 changes: 5 additions & 1 deletion docs/api/puppeteer.executablepath.md
Expand Up @@ -7,5 +7,9 @@ sidebar_label: executablePath
**Signature:**

```typescript
executablePath: (channel?: string | undefined) => string;
executablePath: (
channel?:
| import('puppeteer-core/internal/node/LaunchOptions.js').ChromeReleaseChannel
| undefined
) => string;
```
2 changes: 1 addition & 1 deletion docs/api/puppeteer.launch.md
Expand Up @@ -11,5 +11,5 @@ launch: (
options?:
| import('puppeteer-core/internal/node/PuppeteerNode.js').PuppeteerLaunchOptions
| undefined
) => Promise<import('./types').Browser>;
) => Promise<import('./types.js').Browser>;
```
2 changes: 1 addition & 1 deletion docs/api/puppeteer.productlauncher.defaultargs.md
Expand Up @@ -7,7 +7,7 @@ sidebar_label: ProductLauncher.defaultArgs
**Signature:**

```typescript
interface ProductLauncher {
class ProductLauncher {
defaultArgs(object: BrowserLaunchArgumentOptions): string[];
}
```
Expand Down