docs: improve addCookies.cookie parameter description

This commit is contained in:
Yury Semikhatsky 2024-06-26 14:58:36 -07:00
parent 41b185d643
commit c5516a7467
2 changed files with 4 additions and 9 deletions

View file

@ -358,17 +358,13 @@ await context.AddCookiesAsync(new[] { cookie1, cookie2 });
- `name` <[string]>
- `value` <[string]>
- `url` ?<[string]> either url or domain / path are required. Optional.
- `domain` ?<[string]> either url or domain / path are required Optional.
- `domain` ?<[string]> For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either url or domain / path are required. Optional.
- `path` ?<[string]> either url or domain / path are required Optional.
- `expires` ?<[float]> Unix time in seconds. Optional.
- `httpOnly` ?<[boolean]> Optional.
- `secure` ?<[boolean]> Optional.
- `sameSite` ?<[SameSiteAttribute]<"Strict"|"Lax"|"None">> Optional.
Adds cookies to the browser context.
For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com".
## async method: BrowserContext.addInitScript
* since: v1.8

View file

@ -8286,9 +8286,7 @@ export interface BrowserContext {
* await browserContext.addCookies([cookieObject1, cookieObject2]);
* ```
*
* @param cookies Adds cookies to the browser context.
*
* For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com".
* @param cookies
*/
addCookies(cookies: ReadonlyArray<{
name: string;
@ -8301,7 +8299,8 @@ export interface BrowserContext {
url?: string;
/**
* either url or domain / path are required Optional.
* For the cookie to apply to all subdomains as well, prefix domain with a dot, like this: ".example.com". Either url
* or domain / path are required. Optional.
*/
domain?: string;