Skip to content

Commit

Permalink
chore(docs): add remote configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lipraty committed Jun 8, 2024
1 parent 1a9b727 commit f4e9e4c
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions docs/plugins/puppeteer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,32 @@

## 配置项

### executablePath
### 连接配置

#### remote

- 类型:`boolean`

是否使用远程浏览器。

#### endpoint

- 类型:`string`

远程浏览器的地址。

::: tip
支持 HTTP 或 WebSocket 协议。请在启动浏览器时指定 `--remote-debugging-port` 参数以开启远程调试和确定其端口。

- HTTP 协议:`http(s)://{host}:{port}`
- WebSocket 协议:`ws(s)://{host}:{port}/devtools/browser/{id}`
:::

#### headers

- 类型:`Record<string, string>`

#### executablePath

- 类型:`string`

Expand All @@ -14,28 +39,30 @@
目前仅支持 Chrome 和 Edge 的寻找。Firefox 用户请手动配置此项或者欢迎 pull request。
:::

### headless
#### headless

- 类型:`boolean`
- 默认值:`true`

是否开启[无头模式](https://developer.chrome.com/blog/headless-chrome/)

### args
#### args

- 类型:`string[]`

额外的浏览器参数。Chromium 参数可以参考[这个页面](https://peter.sh/experiments/chromium-command-line-switches/)

### defaultViewport
### 浏览器配置

#### defaultViewport

默认的设备缩放比率。有以下属性:

- width: `number` 视图宽度,默认为 800
- height: `number` 视图高度,默认为 600
- deviceScaleFactor: `number` 设备缩放比率,默认为 2

### ignoreHTTPSErrors
#### ignoreHTTPSErrors

- 类型:`boolean`
- 默认值:`false`
Expand Down

0 comments on commit f4e9e4c

Please sign in to comment.