Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: mention empty string in `userDataDir` (#9069)

Szymon Marczak44c3b0270ebc
diff --git a/docs/src/api/class-browsertype.md b/docs/src/api/class-browsertype.md
index 414ce0323c..5b0ca27349 100644
--- a/docs/src/api/class-browsertype.md
+++ b/docs/src/api/class-browsertype.md
@@ -244,7 +244,8 @@ this context will automatically close the browser.
Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for
[Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and
[Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile).
-Note that Chromium's user data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`.
+Note that Chromium's user data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`. Pass an empty string to
+use a temporary directory instead.
### option: BrowserType.launchPersistentContext.-inline- = %%-shared-browser-options-list-%%
### option: BrowserType.launchPersistentContext.slowMo = %%-browser-option-slowmo-%%
diff --git a/types/types.d.ts b/types/types.d.ts
index 2d7909680b..85cf211f82 100644
--- a/types/types.d.ts
+++ b/types/types.d.ts
@@ -9656,7 +9656,8 @@ export interface BrowserType<Unused = {}> {
* context will automatically close the browser.
* @param userDataDir Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for [Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#introduction) and
* [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile). Note that Chromium's user
- * data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`.
+ * data directory is the **parent** directory of the "Profile Path" seen at `chrome://version`. Pass an empty string to use
+ * a temporary directory instead.
* @param options
*/
launchPersistentContext(userDataDir: string, options?: {