You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-src/api-body.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -545,6 +545,11 @@ Whether to emulate network being offline for the browser context.
545
545
546
546
Returns storage state for this browser context, contains current cookies and local storage snapshot.
547
547
548
+
### option: BrowserContext.storageState.path
549
+
-`path` <[string]>
550
+
551
+
The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to [current working directory](https://nodejs.org/api/process.html#process_process_cwd). If no path is provided, storage state is still returned, but won't be saved to the disk.
552
+
548
553
## async method: BrowserContext.unroute
549
554
550
555
Removes a route created with [browserContext.route()](). When `handler` is not specified, removes all routes for the
Copy file name to clipboardExpand all lines: docs/api.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -246,7 +246,7 @@ Indicates that the browser is connected.
246
246
-`bypass` <[string]> Optional coma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
247
247
-`username` <[string]> Optional username to use if HTTP proxy requires authentication.
248
248
-`password` <[string]> Optional password to use if HTTP proxy requires authentication.
249
-
-`storageState` <[Object]> Populates context with given storage state. This method can be used to initialize context with logged-in information obtained via [browserContext.storageState()](#browsercontextstoragestate).
249
+
-`storageState` <[string]|[Object]> Populates context with given storage state. This method can be used to initialize context with logged-in information obtained via [browserContext.storageState([options])](#browsercontextstoragestateoptions). Either a path to the file with saved storage, or an object with the following fields:
250
250
-`cookies` <[Array]<[Object]>> Optional cookies to set for context
251
251
-`name` <[string]> **required**
252
252
-`value` <[string]> **required**
@@ -321,7 +321,7 @@ Creates a new browser context. It won't share cookies/cache with other browser c
321
321
-`bypass` <[string]> Optional coma-separated domains to bypass proxy, for example `".com, chromium.org, .domain.com"`.
322
322
-`username` <[string]> Optional username to use if HTTP proxy requires authentication.
323
323
-`password` <[string]> Optional password to use if HTTP proxy requires authentication.
324
-
-`storageState` <[Object]> Populates context with given storage state. This method can be used to initialize context with logged-in information obtained via [browserContext.storageState()](#browsercontextstoragestate).
324
+
-`storageState` <[string]|[Object]> Populates context with given storage state. This method can be used to initialize context with logged-in information obtained via [browserContext.storageState([options])](#browsercontextstoragestateoptions). Either a path to the file with saved storage, or an object with the following fields:
325
325
-`cookies` <[Array]<[Object]>> Optional cookies to set for context
-`offline` <[boolean]> Whether to emulate network being offline for the browser context.
746
746
- returns: <[Promise]>
747
747
748
-
#### browserContext.storageState()
748
+
#### browserContext.storageState([options])
749
+
-`options` <[Object]>
750
+
-`path` <[string]> The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to [current working directory](https://nodejs.org/api/process.html#process_process_cwd). If no path is provided, storage state is still returned, but won't be saved to the disk.
0 commit comments