From ca753e1884a5f06dd10a7e7d9c8e636a5d53c575 Mon Sep 17 00:00:00 2001 From: Debbie O'Brien Date: Wed, 7 Sep 2022 12:47:10 +0200 Subject: [PATCH] docs: remove toc and api reference (#17098) --- docs/src/dialogs.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/src/dialogs.md b/docs/src/dialogs.md index db4a241d92..6dd5bac06e 100644 --- a/docs/src/dialogs.md +++ b/docs/src/dialogs.md @@ -7,7 +7,7 @@ Playwright can interact with the web page dialogs such as [`alert`](https://deve ## alert(), confirm(), prompt() dialogs -By default, dialogs are auto-dismissed by Playwright, so you don't have to handle them. However, you can register a dialog handler before the action that triggers the dialog to accept or decline it. +By default, dialogs are auto-dismissed by Playwright, so you don't have to handle them. However, you can register a dialog handler before the action that triggers the dialog to either [`method: Dialog.accept`] or [`method: Dialog.dismiss`] it. ```js page.on('dialog', dialog => dialog.accept()); @@ -35,7 +35,7 @@ await page.Locator("button").ClickAsync(); ``` :::note -[`event: Page.dialog`] listener **must handle** the dialog. Otherwise your action will stall, be it [`method: Page.click`], [`method: Page.evaluate`] or any other. That's because dialogs in Web are modals and therefore block further page execution until they are handled. +[`event: Page.dialog`] listener **must handle** the dialog. Otherwise your action will stall, be it [`method: Locator.click`] or something else. That's because dialogs in Web are modals and therefore block further page execution until they are handled. ::: As a result, the following snippet will never resolve: @@ -73,12 +73,6 @@ await page.Locator("button").ClickAsync(); // Will hang here If there is no listener for [`event: Page.dialog`], all dialogs are automatically dismissed. ::: -### API reference - -- [Dialog] -- [`method: Dialog.accept`] -- [`method: Dialog.dismiss`] - ## beforeunload dialog When [`method: Page.close`] is invoked with the truthy [`option: runBeforeUnload`] value, the page runs its unload handlers. This is the only case when [`method: Page.close`] does not wait for the page to actually close, because it might be that the page stays open in the end of the operation.