From 5f86253ad4df6ef577b7273dba0a0985fdcd0463 Mon Sep 17 00:00:00 2001 From: Blake Williams Date: Wed, 26 Aug 2020 00:05:27 -0400 Subject: [PATCH] docs: add more detail to waitForNavigation API method (#3635) --- docs/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index af244348c6..df732e45c7 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1935,12 +1935,12 @@ Shortcut for [page.mainFrame().waitForLoadState([options])](#framewaitforloadsta - returns: <[Promise]<[null]|[Response]>> Promise which resolves to the main resource response. In case of multiple redirects, the navigation will resolve with the response of the last redirect. In case of navigation to a different anchor or navigation due to History API usage, the navigation will resolve with `null`. This resolves when the page navigates to a new URL or reloads. It is useful for when you run code -which will indirectly cause the page to navigate. Consider this example: +which will indirectly cause the page to navigate. e.g. The click target has an `onclick` handler that triggers navigation from a `setTimeout`. Consider this example: ```js const [response] = await Promise.all([ page.waitForNavigation(), // The promise resolves after navigation has finished - page.click('a.my-link'), // Clicking the link will indirectly cause a navigation + page.click('a.delayed-navigation'), // Clicking the link will indirectly cause a navigation ]); ```