From 66a0d5cbcc6cfb6eb1dfe77203ec995246ce3ebf Mon Sep 17 00:00:00 2001 From: David Barton <43063460+theDavidBarton@users.noreply.github.com> Date: Tue, 6 Apr 2021 12:10:00 +0200 Subject: [PATCH] docs(api): major grammatical corrections (#7011) * docs(api): major grammatical corrections * fix: own typo in Keyboard comment Co-authored-by: Jack Franklin --- docs/api.md | 102 ++++++++++++++++++++++++++-------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/docs/api.md b/docs/api.md index 9a37dc7f..1e309c2b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -439,7 +439,7 @@ If Puppeteer doesn't find them in the environment during the installation step, - `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY` - defines HTTP proxy settings that are used to download and run Chromium. - `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` - do not download bundled Chromium during installation step. - `PUPPETEER_DOWNLOAD_HOST` - overwrite URL prefix that is used to download Chromium. Note: this includes protocol and might even include path prefix. Defaults to `https://storage.googleapis.com`. -- `PUPPETEER_DOWNLOAD_PATH` - overwrite the path for the downloads folder. Defaults to `/.local-chromium`, where `` is puppeteer's package root. +- `PUPPETEER_DOWNLOAD_PATH` - overwrite the path for the downloads folder. Defaults to `/.local-chromium`, where `` is Puppeteer's package root. - `PUPPETEER_CHROMIUM_REVISION` - specify a certain version of Chromium you'd like Puppeteer to use. See [puppeteer.launch([options])](#puppeteerlaunchoptions) on how executable path is inferred. **BEWARE**: Puppeteer is only [guaranteed to work](https://github.com/puppeteer/puppeteer/#q-why-doesnt-puppeteer-vxxx-work-with-chromium-vyyy) with the bundled Chromium, use at your own risk. - `PUPPETEER_EXECUTABLE_PATH` - specify an executable path to be used in `puppeteer.launch`. See [puppeteer.launch([options])](#puppeteerlaunchoptions) on how the executable path is inferred. **BEWARE**: Puppeteer is only [guaranteed to work](https://github.com/puppeteer/puppeteer/#q-why-doesnt-puppeteer-vxxx-work-with-chromium-vyyy) with the bundled Chromium, use at your own risk. - `PUPPETEER_PRODUCT` - specify which browser you'd like Puppeteer to use. Must be one of `chrome` or `firefox`. This can also be used during installation to fetch the recommended browser binary. Setting `product` programmatically in [puppeteer.launch([options])](#puppeteerlaunchoptions) supersedes this environment variable. The product is exposed in [`puppeteer.product`](#puppeteerproduct) @@ -503,12 +503,12 @@ Clears all registered handlers. - `options` <[Object]> - `browserWSEndpoint` a [browser websocket endpoint](#browserwsendpoint) to connect to. - - `browserURL` a browser url to connect to, in format `http://${host}:${port}`. Use interchangeably with `browserWSEndpoint` to let Puppeteer fetch it from [metadata endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target). + - `browserURL` a browser URL to connect to, in format `http://${host}:${port}`. Use interchangeably with `browserWSEndpoint` to let Puppeteer fetch it from [metadata endpoint](https://chromedevtools.github.io/devtools-protocol/#how-do-i-access-the-browser-target). - `ignoreHTTPSErrors` <[boolean]> Whether to ignore HTTPS errors during navigation. Defaults to `false`. - `defaultViewport` Sets a consistent viewport for each page. Defaults to an 800x600 viewport. `null` disables the default viewport. - `width` <[number]> page width in pixels. - `height` <[number]> page height in pixels. - - `deviceScaleFactor` <[number]> Specify device scale factor (can be thought of as dpr). Defaults to `1`. + - `deviceScaleFactor` <[number]> Specify device scale factor (can be thought of as DPR). Defaults to `1`. - `isMobile` <[boolean]> Whether the `meta viewport` tag is taken into account. Defaults to `false`. - `hasTouch`<[boolean]> Specifies if viewport supports touch events. Defaults to `false` - `isLandscape` <[boolean]> Specifies if viewport is in landscape mode. Defaults to `false`. @@ -523,7 +523,7 @@ This methods attaches Puppeteer to an existing browser instance. - `options` <[Object]> - `host` <[string]> A download host to be used. Defaults to `https://storage.googleapis.com`. If the `product` is `firefox`, this defaults to `https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central`. - - `path` <[string]> A path for the downloads folder. Defaults to `/.local-chromium`, where `` is puppeteer's package root. If the `product` is `firefox`, this defaults to `/.local-firefox`. + - `path` <[string]> A path for the downloads folder. Defaults to `/.local-chromium`, where `` is Puppeteer's package root. If the `product` is `firefox`, this defaults to `/.local-firefox`. - `platform` <"linux"|"mac"|"win32"|"win64"> [string] for the current platform. Possible values are: `mac`, `win32`, `win64`, `linux`. Defaults to the current platform. - `product` <"chrome"|"firefox"> [string] for the product to run. Possible values are: `chrome`, `firefox`. Defaults to `chrome`. - returns: <[BrowserFetcher]> @@ -606,7 +606,7 @@ try { - `defaultViewport` Sets a consistent viewport for each page. Defaults to an 800x600 viewport. `null` disables the default viewport. - `width` <[number]> page width in pixels. - `height` <[number]> page height in pixels. - - `deviceScaleFactor` <[number]> Specify device scale factor (can be thought of as dpr). Defaults to `1`. + - `deviceScaleFactor` <[number]> Specify device scale factor (can be thought of as DPR). Defaults to `1`. - `isMobile` <[boolean]> Whether the `meta viewport` tag is taken into account. Defaults to `false`. - `hasTouch`<[boolean]> Specifies if viewport supports touch events. Defaults to `false` - `isLandscape` <[boolean]> Specifies if viewport is in landscape mode. Defaults to `false`. @@ -672,7 +672,7 @@ The product is set by the `PUPPETEER_PRODUCT` environment variable or the `produ - `name` <[string]> The name that the custom query handler will be registered under. - `queryHandler` <[CustomQueryHandler]> The [custom query handler](#interface-customqueryhandler) to register. -Registers a [custom query handler](#interface-customqueryhandler). After registration, the handler can be used everywhere where a selector is expected by prepending the selection string with `/`. The name is only allowed to consist of lower- and upper case latin letters. +Registers a [custom query handler](#interface-customqueryhandler). After registration, the handler can be used everywhere where a selector is expected by prepending the selection string with `/`. The name is only allowed to consist of lower and upper case Latin letters. Example: @@ -726,7 +726,7 @@ The method initiates a HEAD request to check if the revision is available. - `revision` <[string]> a revision to download. - `progressCallback` <[function]([number], [number])> A function that will be called with two arguments: - `downloadedBytes` <[number]> how many bytes have been downloaded - - `totalBytes` <[number]> how large is the total download. + - `totalBytes` <[number]> how large is the total download - returns: <[Promise]<[Object]>> Resolves with revision information when the revision is downloaded and extracted - `revision` <[string]> the revision the info was created from - `folderPath` <[string]> path to the extracted revision folder @@ -820,7 +820,7 @@ Emitted when Puppeteer gets disconnected from the Chromium instance. This might - <[Target]> -Emitted when the url of a target changes. +Emitted when the URL of a target changes. > **NOTE** This includes target changes in incognito browser contexts. @@ -879,7 +879,7 @@ Returns the default browser context. The default browser context can not be clos #### browser.disconnect() -Disconnects Puppeteer from the browser, but leaves the Chromium process running. After calling `disconnect`, the [Browser] object is considered disposed and cannot be used anymore. +Disconnects Puppeteer from the browser but leaves the Chromium process running. After calling `disconnect`, the [Browser] object is considered disposed and cannot be used anymore. #### browser.isConnected() @@ -949,7 +949,7 @@ const newWindowTarget = await browser.waitForTarget( #### browser.wsEndpoint() -- returns: <[string]> Browser websocket url. +- returns: <[string]> Browser websocket URL. Browser websocket endpoint which can be used as an argument to [puppeteer.connect](#puppeteerconnectoptions). The format is `ws://${host}:${port}/devtools/browser/` @@ -984,7 +984,7 @@ await context.close(); - <[Target]> -Emitted when the url of a target inside the browser context changes. +Emitted when the URL of a target inside the browser context changes. #### event: 'targetcreated' @@ -1195,7 +1195,7 @@ Emitted when a frame is detached. - <[Frame]> -Emitted when a frame is navigated to a new url. +Emitted when a frame is navigated to a new URL. #### event: 'load' @@ -1357,10 +1357,10 @@ Shortcut for [page.mainFrame().$x(expression)](#framexexpression) - `url` <[string]> URL of a script to be added. - `path` <[string]> Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to [current working directory](https://nodejs.org/api/process.html#process_process_cwd). - `content` <[string]> Raw JavaScript content to be injected into frame. - - `type` <[string]> Script type. Use 'module' in order to load a Javascript ES6 module. See [script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details. + - `type` <[string]> Script type. Use 'module' in order to load a JavaScript ES6 module. See [script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details. - returns: <[Promise]<[ElementHandle]>> which resolves to the added tag when the script's onload fires or when the script content was injected into frame. -Adds a `