-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: browser level cookies API (#13316)
Co-authored-by: Alex Rudenko <[email protected]>
- Loading branch information
Showing
23 changed files
with
928 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
sidebar_label: Browser.cookies | ||
--- | ||
|
||
# Browser.cookies() method | ||
|
||
Returns all cookies in the default [BrowserContext](./puppeteer.browsercontext.md). | ||
|
||
### Signature | ||
|
||
```typescript | ||
class Browser { | ||
cookies(): Promise<Cookie[]>; | ||
} | ||
``` | ||
|
||
**Returns:** | ||
|
||
Promise<[Cookie](./puppeteer.cookie.md)\[\]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
sidebar_label: Browser.deleteCookie | ||
--- | ||
|
||
# Browser.deleteCookie() method | ||
|
||
Removes cookies from the default [BrowserContext](./puppeteer.browsercontext.md). | ||
|
||
### Signature | ||
|
||
```typescript | ||
class Browser { | ||
deleteCookie(...cookies: Cookie[]): Promise<void>; | ||
} | ||
``` | ||
|
||
## Parameters | ||
|
||
<table><thead><tr><th> | ||
|
||
Parameter | ||
|
||
</th><th> | ||
|
||
Type | ||
|
||
</th><th> | ||
|
||
Description | ||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
cookies | ||
|
||
</td><td> | ||
|
||
[Cookie](./puppeteer.cookie.md)\[\] | ||
|
||
</td><td> | ||
|
||
</td></tr> | ||
</tbody></table> | ||
**Returns:** | ||
|
||
Promise<void> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
sidebar_label: Browser.setCookie | ||
--- | ||
|
||
# Browser.setCookie() method | ||
|
||
Sets cookies in the default [BrowserContext](./puppeteer.browsercontext.md). | ||
|
||
### Signature | ||
|
||
```typescript | ||
class Browser { | ||
setCookie(...cookies: Cookie[]): Promise<void>; | ||
} | ||
``` | ||
|
||
## Parameters | ||
|
||
<table><thead><tr><th> | ||
|
||
Parameter | ||
|
||
</th><th> | ||
|
||
Type | ||
|
||
</th><th> | ||
|
||
Description | ||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
cookies | ||
|
||
</td><td> | ||
|
||
[Cookie](./puppeteer.cookie.md)\[\] | ||
|
||
</td><td> | ||
|
||
</td></tr> | ||
</tbody></table> | ||
**Returns:** | ||
|
||
Promise<void> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
sidebar_label: BrowserContext.cookies | ||
--- | ||
|
||
# BrowserContext.cookies() method | ||
|
||
Gets all cookies in the browser context. | ||
|
||
### Signature | ||
|
||
```typescript | ||
class BrowserContext { | ||
abstract cookies(): Promise<Cookie[]>; | ||
} | ||
``` | ||
|
||
**Returns:** | ||
|
||
Promise<[Cookie](./puppeteer.cookie.md)\[\]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
sidebar_label: BrowserContext.deleteCookie | ||
--- | ||
|
||
# BrowserContext.deleteCookie() method | ||
|
||
Removes cookie in the browser context | ||
|
||
### Signature | ||
|
||
```typescript | ||
class BrowserContext { | ||
deleteCookie(...cookies: Cookie[]): Promise<void>; | ||
} | ||
``` | ||
|
||
## Parameters | ||
|
||
<table><thead><tr><th> | ||
|
||
Parameter | ||
|
||
</th><th> | ||
|
||
Type | ||
|
||
</th><th> | ||
|
||
Description | ||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
cookies | ||
|
||
</td><td> | ||
|
||
[Cookie](./puppeteer.cookie.md)\[\] | ||
|
||
</td><td> | ||
|
||
[cookie](./puppeteer.cookie.md) to remove | ||
|
||
</td></tr> | ||
</tbody></table> | ||
**Returns:** | ||
|
||
Promise<void> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
sidebar_label: BrowserContext.setCookie | ||
--- | ||
|
||
# BrowserContext.setCookie() method | ||
|
||
Sets a cookie in the browser context. | ||
|
||
### Signature | ||
|
||
```typescript | ||
class BrowserContext { | ||
abstract setCookie(...cookies: Cookie[]): Promise<void>; | ||
} | ||
``` | ||
|
||
## Parameters | ||
|
||
<table><thead><tr><th> | ||
|
||
Parameter | ||
|
||
</th><th> | ||
|
||
Type | ||
|
||
</th><th> | ||
|
||
Description | ||
|
||
</th></tr></thead> | ||
<tbody><tr><td> | ||
|
||
cookies | ||
|
||
</td><td> | ||
|
||
[Cookie](./puppeteer.cookie.md)\[\] | ||
|
||
</td><td> | ||
|
||
[cookie](./puppeteer.cookie.md) to set | ||
|
||
</td></tr> | ||
</tbody></table> | ||
**Returns:** | ||
|
||
Promise<void> |
Oops, something went wrong.