From e382bb329b5574b490857b3f6545dd4bfa618978 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 12 Mar 2020 11:20:03 -0700 Subject: [PATCH] api: remove 'commit' phase, actions to wait until 'domcontentloaded' by default (#1358) --- docs/api.md | 185 +++++++++++++++--------------------- src/frames.ts | 8 +- src/page.ts | 4 +- src/types.ts | 4 +- test/browsercontext.spec.js | 4 +- test/navigation.spec.js | 100 +++++++++++++------ test/popup.spec.js | 2 +- 7 files changed, 156 insertions(+), 151 deletions(-) diff --git a/docs/api.md b/docs/api.md index ddc2bccffe..b41d8b52f9 100644 --- a/docs/api.md +++ b/docs/api.md @@ -921,10 +921,9 @@ Shortcut for [page.mainFrame().addStyleTag(options)](#frameaddstyletagoptions). - is not moving (for example, waits until css transition finishes), - receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements). Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`. - - `waitUntil` <"commit"|"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to `commit` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: - - `'commit'` - navigation is committed, new url is displayed in the browser address bar. - - `'load'` - consider navigation to be finished when the `load` event is fired. + - `waitUntil` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to fire `domcontentloaded` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired. + - `'load'` - consider navigation to be finished when the `load` event is fired. - `'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms. - `'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms. - `'nowait'` - do not wait. @@ -951,10 +950,9 @@ Shortcut for [page.mainFrame().check(selector[, options])](#framecheckselector-o - is not moving (for example, waits until css transition finishes), - receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements). Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`. - - `waitUntil` <"commit"|"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to `commit` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: - - `'commit'` - navigation is committed, new url is displayed in the browser address bar. - - `'load'` - consider navigation to be finished when the `load` event is fired. + - `waitUntil` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to fire `domcontentloaded` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired. + - `'load'` - consider navigation to be finished when the `load` event is fired. - `'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms. - `'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms. - `'nowait'` - do not wait. @@ -1010,10 +1008,9 @@ Browser-specific Coverage implementation, only available for Chromium atm. See [ - is not moving (for example, waits until css transition finishes), - receives pointer events at the action point (for example, waits until element becomes non-obscured by other elements). Even if the action is forced, it will wait for the element matching selector to be in DOM. Defaults to `false`. - - `waitUntil` <"commit"|"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to `commit` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: - - `'commit'` - navigation is committed, new url is displayed in the browser address bar. - - `'load'` - consider navigation to be finished when the `load` event is fired. + - `waitUntil` <"load"|"domcontentloaded"|"networkidle0"|"networkidle2"|"nowait"> Actions that cause navigations are waiting for those navigations to fire `domcontentloaded` by default. This behavior can be changed to either wait for another load phase or to omit the waiting altogether using `nowait`: - `'domcontentloaded'` - consider navigation to be finished when the `DOMContentLoaded` event is fired. + - `'load'` - consider navigation to be finished when the `load` event is fired. - `'networkidle0'` - consider navigation to be finished when there are no more than 0 network connections for at least `500` ms. - `'networkidle2'` - consider navigation to be finished when there are no more than 2 network connections for at least `500` ms. - `'nowait'` - do not wait. @@ -1188,10 +1185,9 @@ const fs = require('fs'); - `selector` <[string]> A selector to query page for. - `value` <[string]> Value to fill for the ``, `