diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md
index 4d252112cd..3461ac9928 100644
--- a/docs/src/api/class-page.md
+++ b/docs/src/api/class-page.md
@@ -3138,11 +3138,9 @@ Things to keep in mind:
:::warning
Running the handler will alter your page state mid-test. For example it will change the currently focused element and move the mouse. Make sure that actions that run after the handler are self-contained and do not rely on the focus and mouse state being unchanged.
-
-
+
For example, consider a test that calls [`method: Locator.focus`] followed by [`method: Keyboard.press`]. If your handler clicks a button between these two actions, the focused element most likely will be wrong, and key press will happen on the unexpected element. Use [`method: Locator.press`] instead to avoid this problem.
-
-
+
Another example is a series of mouse actions, where [`method: Mouse.move`] is followed by [`method: Mouse.down`]. Again, when the handler runs between these two actions, the mouse position will be wrong during the mouse down. Prefer self-contained actions like [`method: Locator.click`] that do not rely on the state being unchanged by a handler.
:::
diff --git a/docs/src/selenium-grid.md b/docs/src/selenium-grid.md
index 636bfb6d43..88a08684f2 100644
--- a/docs/src/selenium-grid.md
+++ b/docs/src/selenium-grid.md
@@ -10,8 +10,6 @@ Playwright can connect to [Selenium Grid Hub](https://www.selenium.dev/documenta
:::warning
There is a risk of Playwright integration with Selenium Grid Hub breaking in the future. Make sure you weight risks against benefits before using it.
-
-
More details
diff --git a/docs/src/trace-viewer.md b/docs/src/trace-viewer.md
index 4f6b812e91..55338c41b9 100644
--- a/docs/src/trace-viewer.md
+++ b/docs/src/trace-viewer.md
@@ -48,8 +48,6 @@ When tracing with the [`option: Tracing.start.snapshots`] option turned on (defa
|Action|A snapshot at the moment of the performed input. This type of snapshot is especially useful when exploring where exactly Playwright clicked.|
|After|A snapshot after the action.|
-
-
Here is what the typical Action snapshot looks like:

diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts
index 6702fc9fb2..6fc76d0dbd 100644
--- a/packages/playwright-core/types/types.d.ts
+++ b/packages/playwright-core/types/types.d.ts
@@ -299,6 +299,7 @@ export interface Page {
* [browserContext.addInitScript(script[, arg])](https://playwright.dev/docs/api/class-browsercontext#browser-context-add-init-script)
* and [page.addInitScript(script[, arg])](https://playwright.dev/docs/api/class-page#page-add-init-script) is not
* defined.
+ *
* @param script Script to be evaluated in the page.
* @param arg Optional argument to pass to
* [`script`](https://playwright.dev/docs/api/class-page#page-add-init-script-option-script) (only supported when
@@ -1075,6 +1076,7 @@ export interface Page {
* **NOTE** When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) or
* [browserContext.on('dialog')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-dialog)
* listeners are present, all dialogs are automatically dismissed.
+ *
*/
on(event: 'dialog', listener: (dialog: Dialog) => any): this;
@@ -1166,6 +1168,7 @@ export interface Page {
* **NOTE** Use
* [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
* wait until the page gets to a particular state (you should not need it in most cases).
+ *
*/
on(event: 'popup', listener: (page: Page) => any): this;
@@ -1191,6 +1194,7 @@ export interface Page {
* with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
* will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network
* error net::ERR_FAILED.
+ *
*/
on(event: 'requestfailed', listener: (request: Request) => any): this;
@@ -1374,6 +1378,7 @@ export interface Page {
* **NOTE** When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) or
* [browserContext.on('dialog')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-dialog)
* listeners are present, all dialogs are automatically dismissed.
+ *
*/
addListener(event: 'dialog', listener: (dialog: Dialog) => any): this;
@@ -1465,6 +1470,7 @@ export interface Page {
* **NOTE** Use
* [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
* wait until the page gets to a particular state (you should not need it in most cases).
+ *
*/
addListener(event: 'popup', listener: (page: Page) => any): this;
@@ -1490,6 +1496,7 @@ export interface Page {
* with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
* will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network
* error net::ERR_FAILED.
+ *
*/
addListener(event: 'requestfailed', listener: (request: Request) => any): this;
@@ -1768,6 +1775,7 @@ export interface Page {
* **NOTE** When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) or
* [browserContext.on('dialog')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-dialog)
* listeners are present, all dialogs are automatically dismissed.
+ *
*/
prependListener(event: 'dialog', listener: (dialog: Dialog) => any): this;
@@ -1859,6 +1867,7 @@ export interface Page {
* **NOTE** Use
* [page.waitForLoadState([state, options])](https://playwright.dev/docs/api/class-page#page-wait-for-load-state) to
* wait until the page gets to a particular state (you should not need it in most cases).
+ *
*/
prependListener(event: 'popup', listener: (page: Page) => any): this;
@@ -1884,6 +1893,7 @@ export interface Page {
* with [page.on('requestfailed')](https://playwright.dev/docs/api/class-page#page-event-request-failed). A request
* will only be considered failed when the client cannot get an HTTP response from the server, e.g. due to network
* error net::ERR_FAILED.
+ *
*/
prependListener(event: 'requestfailed', listener: (request: Request) => any): this;
@@ -1937,13 +1947,17 @@ export interface Page {
*
* **NOTE** Running the handler will alter your page state mid-test. For example it will change the currently focused
* element and move the mouse. Make sure that actions that run after the handler are self-contained and do not rely on
- * the focus and mouse state being unchanged.
For example, consider a test that calls
+ * the focus and mouse state being unchanged.
+ *
+ * For example, consider a test that calls
* [locator.focus([options])](https://playwright.dev/docs/api/class-locator#locator-focus) followed by
* [keyboard.press(key[, options])](https://playwright.dev/docs/api/class-keyboard#keyboard-press). If your handler
* clicks a button between these two actions, the focused element most likely will be wrong, and key press will happen
* on the unexpected element. Use
* [locator.press(key[, options])](https://playwright.dev/docs/api/class-locator#locator-press) instead to avoid this
- * problem.
Another example is a series of mouse actions, where
+ * problem.
+ *
+ * Another example is a series of mouse actions, where
* [mouse.move(x, y[, options])](https://playwright.dev/docs/api/class-mouse#mouse-move) is followed by
* [mouse.down([options])](https://playwright.dev/docs/api/class-mouse#mouse-down). Again, when the handler runs
* between these two actions, the mouse position will be wrong during the mouse down. Prefer self-contained actions
@@ -2255,6 +2269,7 @@ export interface Page {
* **NOTE** if [`runBeforeUnload`](https://playwright.dev/docs/api/class-page#page-close-option-run-before-unload) is
* passed as true, a `beforeunload` dialog might be summoned and should be handled manually via
* [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) event.
+ *
* @param options
*/
close(options?: {
@@ -2303,6 +2318,7 @@ export interface Page {
* [TimeoutError](https://playwright.dev/docs/api/class-timeouterror). Passing zero timeout disables this.
*
* **NOTE** `page.dblclick()` dispatches two `click` events and a single `dblclick` event.
+ *
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be
* used.
* @param options
@@ -2912,6 +2928,7 @@ export interface Page {
*
* **NOTE** Unlike most other attributes, `disabled` is inherited through the DOM hierarchy. Learn more about
* [`aria-disabled`](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled).
+ *
*/
disabled?: boolean;
@@ -3169,6 +3186,7 @@ export interface Page {
*
* **NOTE** Headless mode doesn't support navigation to a PDF document. See the
* [upstream issue](https://bugs.chromium.org/p/chromium/issues/detail?id=761295).
+ *
* @param url URL to navigate page to. The url should include scheme, e.g. `https://`. When a
* [`baseURL`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-base-url) via the context
* options was provided and the passed URL is a path, it gets merged via the
@@ -3585,6 +3603,7 @@ export interface Page {
*
* **NOTE** This method requires Playwright to be started in a headed mode, with a falsy
* [`headless`](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-headless) option.
+ *
*/
pause(): Promise;
@@ -3642,6 +3661,7 @@ export interface Page {
* [`footerTemplate`](https://playwright.dev/docs/api/class-page#page-pdf-option-footer-template) markup have the
* following limitations: > 1. Script tags inside templates are not evaluated. > 2. Page styles are not visible inside
* templates.
+ *
* @param options
*/
pdf(options?: {
@@ -3951,6 +3971,7 @@ export interface Page {
* [page.unroute(url[, handler])](https://playwright.dev/docs/api/class-page#page-unroute).
*
* **NOTE** Enabling routing disables http cache.
+ *
* @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a
* [`baseURL`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-base-url) via the context
* options was provided and the passed URL is a path, it gets merged via the
@@ -4264,6 +4285,7 @@ export interface Page {
* [browserContext.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout)
* and
* [browserContext.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-navigation-timeout).
+ *
* @param timeout Maximum navigation time in milliseconds
*/
setDefaultNavigationTimeout(timeout: number): void;
@@ -4276,6 +4298,7 @@ export interface Page {
* [page.setDefaultNavigationTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout)
* takes priority over
* [page.setDefaultTimeout(timeout)](https://playwright.dev/docs/api/class-page#page-set-default-timeout).
+ *
* @param timeout Maximum time in milliseconds
*/
setDefaultTimeout(timeout: number): void;
@@ -4286,6 +4309,7 @@ export interface Page {
* **NOTE**
* [page.setExtraHTTPHeaders(headers)](https://playwright.dev/docs/api/class-page#page-set-extra-http-headers) does
* not guarantee the order of headers in the outgoing requests.
+ *
* @param headers An object containing additional HTTP headers to be sent with every request. All header values must be strings.
*/
setExtraHTTPHeaders(headers: { [key: string]: string; }): Promise;
@@ -4421,6 +4445,7 @@ export interface Page {
* **NOTE** [page.tap(selector[, options])](https://playwright.dev/docs/api/class-page#page-tap) the method will throw
* if [`hasTouch`](https://playwright.dev/docs/api/class-browser#browser-new-context-option-has-touch) option of the
* browser context is false.
+ *
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be
* used.
* @param options
@@ -4732,6 +4757,7 @@ export interface Page {
* **NOTE** When no [page.on('dialog')](https://playwright.dev/docs/api/class-page#page-event-dialog) or
* [browserContext.on('dialog')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-dialog)
* listeners are present, all dialogs are automatically dismissed.
+ *
*/
waitForEvent(event: 'dialog', optionsOrPredicate?: { predicate?: (dialog: Dialog) => boolean | Promise, timeout?: number } | ((dialog: Dialog) => boolean | Promise)): Promise