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
-`name` <[string]> Name of the function on the window object.
167
-
-`playwrightBinding` <[function]> Callback function that will be called in the Playwright's context.
167
+
-`callback` <[function]> Callback function that will be called in the Playwright's context.
168
168
-`options` <[Object]>
169
169
-`handle` <[boolean]> Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is supported. When passing by value, multiple arguments are supported.
170
170
- returns: <[Promise]>
171
171
172
-
The method adds a function called `name` on the `window` object of every frame in every page in the context. When called, the function executes `playwrightBinding` and returns a [Promise] which resolves to the return value of `playwrightBinding`. If the `playwrightBinding` returns a [Promise], it will be awaited.
172
+
The method adds a function called `name` on the `window` object of every frame in every page in the context. When called, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`. If the `callback` returns a [Promise], it will be awaited.
173
173
174
-
The first argument of the `playwrightBinding` function contains information about the caller: `{ browserContext: BrowserContext, page: Page, frame: Frame }`.
174
+
The first argument of the `callback` function contains information about the caller: `{ browserContext: BrowserContext, page: Page, frame: Frame }`.
175
175
176
-
See [page.exposeBinding(name, playwrightBinding[, options])](api/class-page.md#pageexposebindingname-playwrightbinding-options) for page-only version.
176
+
See [page.exposeBinding(name, callback[, options])](api/class-page.md#pageexposebindingname-callback-options) for page-only version.
177
177
178
178
An example of exposing page URL to all frames in all pages in the context:
-`name` <[string]> Name of the function on the window object.
218
-
-`playwrightFunction` <[function]> Callback function that will be called in the Playwright's context.
218
+
-`callback` <[function]> Callback function that will be called in the Playwright's context.
219
219
- returns: <[Promise]>
220
220
221
-
The method adds a function called `name` on the `window` object of every frame in every page in the context. When called, the function executes `playwrightFunction` and returns a [Promise] which resolves to the return value of `playwrightFunction`.
221
+
The method adds a function called `name` on the `window` object of every frame in every page in the context. When called, the function executes `callback` and returns a [Promise] which resolves to the return value of `callback`.
222
222
223
-
If the `playwrightFunction` returns a [Promise], it will be awaited.
223
+
If the `callback` returns a [Promise], it will be awaited.
224
224
225
-
See [page.exposeFunction(name, playwrightFunction)](api/class-page.md#pageexposefunctionname-playwrightfunction) for page-only version.
225
+
See [page.exposeFunction(name, callback)](api/class-page.md#pageexposefunctionname-callback) for page-only version.
226
226
227
227
An example of adding an `md5` function to all pages in the context:
228
228
@@ -372,7 +372,7 @@ Provide credentials for [HTTP authentication](https://developer.mozilla.org/en-U
372
372
373
373
## browserContext.storageState([options])
374
374
-`options` <[Object]>
375
-
-`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.
375
+
-`path` <[path]> 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.
Copy file name to clipboardExpand all lines: docs/out/api/class-browsertype.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,9 +46,9 @@ A path where Playwright expects to find a bundled browser executable.
46
46
-`args` <[Array]<[string]>> Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](http://peter.sh/experiments/chromium-command-line-switches/).
47
47
-`chromiumSandbox` <[boolean]> Enable Chromium sandboxing. Defaults to `false`.
48
48
-`devtools` <[boolean]> **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.
49
-
-`downloadsPath` <[string]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
49
+
-`downloadsPath` <[path]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
50
50
-`env` <[Object]<[string], [string]|[number]|[boolean]>> Specify environment variables that will be visible to the browser. Defaults to `process.env`.
51
-
-`executablePath` <[string]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.
51
+
-`executablePath` <[path]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.
52
52
-`firefoxUserPrefs` <[Object]<[string], [string]|[number]|[boolean]>> Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).
53
53
-`handleSIGHUP` <[boolean]> Close the browser process on SIGHUP. Defaults to `true`.
54
54
-`handleSIGINT` <[boolean]> Close the browser process on Ctrl-C. Defaults to `true`.
@@ -84,7 +84,7 @@ const browser = await chromium.launch({ // Or 'firefox' or 'webkit'.
84
84
> See [`this article`](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for a description of the differences between Chromium and Chrome. [`This article`](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md) describes some differences for Linux users.
-`userDataDir` <[string]> 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) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile).
87
+
-`userDataDir` <[path]> 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) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile).
88
88
-`options` <[Object]>
89
89
-`acceptDownloads` <[boolean]> Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.
90
90
-`args` <[Array]<[string]>> Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](http://peter.sh/experiments/chromium-command-line-switches/).
@@ -93,9 +93,9 @@ const browser = await chromium.launch({ // Or 'firefox' or 'webkit'.
93
93
-`colorScheme` <"light"|"dark"|"no-preference"> Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [page.emulateMedia(params)](api/class-page.md#pageemulatemediaparams) for more details. Defaults to '`light`'.
94
94
-`deviceScaleFactor` <[number]> Specify device scale factor (can be thought of as dpr). Defaults to `1`.
95
95
-`devtools` <[boolean]> **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.
96
-
-`downloadsPath` <[string]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
96
+
-`downloadsPath` <[path]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
97
97
-`env` <[Object]<[string], [string]|[number]|[boolean]>> Specify environment variables that will be visible to the browser. Defaults to `process.env`.
98
-
-`executablePath` <[string]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
98
+
-`executablePath` <[path]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
99
99
-`extraHTTPHeaders` <[Object]<[string], [string]>> An object containing additional HTTP headers to be sent with every request. All header values must be strings.
100
100
-`geolocation` <[Object]>
101
101
-`latitude` <[number]> Latitude between -90 and 90.
@@ -152,9 +152,9 @@ Launches browser that uses persistent storage located at `userDataDir` and retur
152
152
-`args` <[Array]<[string]>> Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](http://peter.sh/experiments/chromium-command-line-switches/).
153
153
-`chromiumSandbox` <[boolean]> Enable Chromium sandboxing. Defaults to `true`.
154
154
-`devtools` <[boolean]> **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.
155
-
-`downloadsPath` <[string]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
155
+
-`downloadsPath` <[path]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
156
156
-`env` <[Object]<[string], [string]|[number]|[boolean]>> Specify environment variables that will be visible to the browser. Defaults to `process.env`.
157
-
-`executablePath` <[string]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
157
+
-`executablePath` <[path]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
158
158
-`firefoxUserPrefs` <[Object]<[string], [string]|[number]|[boolean]>> Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).
159
159
-`handleSIGHUP` <[boolean]> Close the browser process on SIGHUP. Defaults to `true`.
160
160
-`handleSIGINT` <[boolean]> Close the browser process on Ctrl-C. Defaults to `true`.
Copy file name to clipboardExpand all lines: docs/out/api/class-elementhandle.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -323,7 +323,7 @@ Shortcuts such as `key: "Control+o"` or `key: "Control+Shift+T"` are supported a
323
323
## elementHandle.screenshot([options])
324
324
-`options` <[Object]>
325
325
-`omitBackground` <[boolean]> Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`.
326
-
-`path` <[string]> The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.
326
+
-`path` <[path]> The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.
327
327
-`quality` <[number]> The quality of the image, between 0-100. Not applicable to `png` images.
328
328
-`timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](api/class-browsercontext.md#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](api/class-page.md#pagesetdefaulttimeouttimeout) methods.
329
329
-`type` <"png"|"jpeg"> Specify screenshot type, defaults to `png`.
0 commit comments