Puppeteer 中文文档v25.8.0

其他

BrowserProvider

自定义浏览器提供程序实现的接口。允许用户为浏览器实现替代下载源。 ⚠️ 重要:自定义提供程序不受 Puppeteer 官方支持。 通过实现此接口,您需对以下事项承担全部责任:

BrowserTag

描述浏览器发布渠道的枚举。 你可以将其与 resolveBuildId() 结合使用,根据发布渠道解析构建 ID。 <table><thead><tr><th>

buildArchiveFilename

用于构建标准归档文件名的实用函数。 <table><thead><tr><th> 参数 </th><th> 类型 </th><th> 说明 </th></tr></thead>

CDP_WEBSOCKET_ENDPOINT_REGEX

ChromeReleaseChannel

<table><thead><tr><th> 成员 </th><th> 值 </th><th> 说明 </th></tr></thead> <tbody><tr><td>

DefaultProvider

使用默认源的默认提供程序实现。这是 Puppeteer 使用的标准提供程序。 实现自: BrowserProvider <table><thead><tr><th>

DownloadOptions

传递给提供程序的选项。 <table><thead><tr><th> 属性 </th><th> 修饰符 </th><th> 类型 </th><th> 说明 </th><th>

getDownloadUrl

获取用于下载指定浏览器二进制归档的 URL。 该归档与指定的特定平台和构建 ID 绑定。 <table><thead><tr><th> 参数 </th><th>

GetInstalledBrowsersOptions

<table><thead><tr><th> 属性 </th><th> 修饰符 </th><th> 类型 </th><th> 说明 </th><th> 默认值 </th></tr></thead>

getVersionComparator

返回指定浏览器的版本比较器,可用于对浏览器版本进行排序。 <table><thead><tr><th> 参数 </th><th> 类型 </th><th> 说明

InstalledBrowser

此类的构造函数被标记为内部。第三方代码不应直接调用构造函数,也不应创建继承 InstalledBrowser 类的子类。 <table><thead><tr><th>

InstallOptions

<table><thead><tr><th> 属性 </th><th> 修饰符 </th><th> 类型 </th><th> 说明 </th><th> 默认值 </th></tr></thead>

LaunchOptions

<table><thead><tr><th> 属性 </th><th> 修饰符 </th><th> 类型 </th><th> 说明 </th><th> 默认值 </th></tr></thead>

Metadata

<table><thead><tr><th> 属性 </th><th> 修饰符 </th><th> 类型 </th><th> 说明 </th><th> 默认值 </th></tr></thead>

Options

<table><thead><tr><th> 属性 </th><th> 修饰符 </th><th> 类型 </th><th> 说明 </th><th> 默认值 </th></tr></thead>

Process

<table><thead><tr><th> 构造函数 </th><th> 修饰符 </th><th> 说明 </th></tr></thead> <tbody><tr><td>

ProfileOptions

<table><thead><tr><th> 属性 </th><th> 修饰符 </th><th> 类型 </th><th> 说明 </th><th> 默认值 </th></tr></thead>

resolveDefaultUserDataDir

返回给定渠道的预期默认用户数据目录。它不检查该目录是否实际存在。 <table><thead><tr><th> 参数 </th><th> 类型 </th><th>

SystemOptions

<table><thead><tr><th> 属性 </th><th> 修饰符 </th><th> 类型 </th><th> 说明 </th><th> 默认值 </th></tr></thead>

TimeoutError

继承自: Error 此类的构造函数被标记为内部使用。第三方代码不应直接调用构造函数,也不应创建继承 TimeoutError 类的子类。

UninstallOptions

<table><thead><tr><th> 属性 </th><th> 修饰符 </th><th> 类型 </th><th> 说明 </th><th> 默认值 </th></tr></thead>

WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX