CookieParam 接口
🌐 CookieParam interface
用于在页面级 cookies API 中设置 cookies 的 Cookie 参数对象。
🌐 Cookie parameter object used to set cookies in the page-level cookies API.
语法
🌐 Signature
export interface CookieParam
属性
🌐 Properties
属性 🌐 Property | 修饰符 🌐 Modifiers | 类型 🌐 Type | 描述 🌐 Description | 默认 🌐 Default |
|---|---|---|---|---|
| domain |
| string | Cookie 域。 🌐 Cookie domain. | |
| expires |
| number | Cookie 过期日期,如果未设置会话 cookie 🌐 Cookie expiration date, session cookie if not set | |
| httpOnly |
| boolean | 如果 cookie 仅限 http,则为 True。 🌐 True if cookie is http-only. | |
| name | string | Cookie 名称。 🌐 Cookie name. | ||
| partitionKey |
| [CookiePartitionKey](./puppeteer.cookiepartitionkey.md) |弦 | Cookie 分区键。在 Chrome 中,它与分区 cookie 可用的顶层站点匹配。在 Firefox 中,它与 PartitionKey 中的源来源匹配。 🌐 Cookie partition key. In Chrome, it matches the top-level site the partitioned cookie is available in. In Firefox, it matches the source origin in the PartitionKey. | |
| path |
| string | Cookie 路径。 🌐 Cookie path. | |
| priority |
| Cookie 优先级。仅在 Chrome 中支持。 🌐 Cookie Priority. Supported only in Chrome. | ||
| sameParty |
| boolean | 已弃用: 总是被忽视。 🌐 Always ignored. | |
| sameSite |
| Cookie SameSite 类型。 🌐 Cookie SameSite type. | ||
| secure |
| boolean | 如果 cookie 是安全的,则为 True。 🌐 True if cookie is secure. | |
| sourceScheme |
| Cookie 源方案类型。仅在 Chrome 中支持。 🌐 Cookie source scheme type. Supported only in Chrome. | ||
| url |
| string | 要与 Cookie 设置关联的请求 URI。此值可以影响所创建 Cookie 的默认域、路径和源方案值。 🌐 The request-URI to associate with the setting of the cookie. This value can affect the default domain, path, and source scheme values of the created cookie. | |
| value | string | Cookie 值。 🌐 Cookie value. |