This CL changes our docs generation to not include automatic docs from
devtools-protocol. Long term we probably want this, but for now it's
generating a vast amount of documentation and it's making setting up the
new website and docs harder. Let's focus just on the pptr docs for now
and revisit this once the foundations have been laid.
This patch adds a reject callback to the _processClosing promise and executes it if it catches an error on removeFolderAsync(...).
Co-authored-by: Mathias Bynens <mathias@qiwi.be>
This change adds a new `channel` parameter to `puppeteer.launch`. When specified, Puppeteer will search for the locally installed release channel of Google Chrome and use it to launch. Available values are `chrome`, `chrome-beta`, `chrome-canary`, `chrome-dev`. This parameter is mutually exclusive with `executablePath`.
With this change,`request.respond`, `request.abort`, and `request.continue` can accept an optional `priority` to activate Cooperative Intercept Mode. In Cooperative Mode, all intercept handlers are guaranteed to run and all async handlers are awaited. The interception is resolved to the highest-priority resolution. See _Cooperative Intercept Mode and Legacy Intercept Mode_ in `docs/api.md` for details.
This patch removes the redundant `await` from the block while fetching the target. The value in the map is a `Target` instance, which itself is not an async resource.
I lost time today due to some old docs files lingering for code that is now gone. To avoid that happening, let's remove the directories before generating.
As part of this work I also changed the API Extractor to not output to `temp/X.api.json` and instead `docs-api-json/X.api.json` to make it clearer what that folder is for.
This commit adds drag-and-drop support, leveraging new additions to the CDP Input domain (Input.setInterceptDrags, Input.dispatchDragEvent, and Input.dragIntercepted).
* fix: modified comment for method product, platform and newPage
* fix: added comment for browsercontext, StartCSSCoverage, StartJSCoverage
* fix: corrected comments for JSONValue, asElement, evaluateHandle
* fix: corrected comments for JSONValue, asElement, evaluateHandle
* fix: added comments for some of the method
* fix: added proper comments
* fix: added comment for some methods in page.ts
* fix: rectified the comments
* fix: changed some of the comments
* fix: added comments for 3 more methods of class page
* fix: added comments for 3 more methods of class page
Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
* fix: modified comment for method product, platform and newPage
* fix: added comment for browsercontext, StartCSSCoverage, StartJSCoverage
* fix: corrected comments for JSONValue, asElement, evaluateHandle
* fix: corrected comments for JSONValue, asElement, evaluateHandle
* fix: added comments for some of the method
* fix: added proper comments
* fix: added comment for some methods in page.ts
* fix: rectified the comments
* fix: changed some of the comments
Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
* fix: modified comment for method product, platform and newPage
* fix: added comment for browsercontext, StartCSSCoverage, StartJSCoverage
* fix: corrected comments for JSONValue, asElement, evaluateHandle
* fix: corrected comments for JSONValue, asElement, evaluateHandle
* fix: added comments for some of the method
* fix: added proper comments
Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
This commit updates the JSHandle class to take a generic representing
the underlying object that it's wrapping. We can then define
`ElementHandle` as a class that extends `JSHandle<Element>` and begin
to get better type inference.
Prior to this commit the following code would have `d` set to `any`:
```
const div: page.$<HTMLDivElement>('div')
const text = await div.evaluate(d => d.innerText)
```
You could work around this in two ways:
```
const text = await div.evaluate<(d: HTMLDivElement) => string>(d => d.innerText)
const text = await div.evaluate((d: HTMLDivElement) => d.innerText)
```
But both of these have two issues:
1. Requires the user to type extra information.
2. There's no type checking: in the code above I could type `d` as
`number` and TS would be happy.
With the change here to `evaluate` the user can now type the original
code:
```
const div: page.$<HTMLDivElement>('div')
const text = await div.evaluate(d => d.innerText)
```
And TypeScript will know that `d` is an `HTMLDivElement`.
This change brings us inline with the approach that @types/puppeteer
takes. If we land this and it works, we can do the same with
`evaluateHandle` to hopefully make a similar improvement there.
BREAKING: because this changes the types, which were previously `any`,
this is technically a breaking change as users using TS could start
getting errors after this change is released.
Just some code reorder. We had a describe between it calls. I'm moving that describe to the end
Co-authored-by: Jack Franklin <jacktfranklin@chromium.org>
The main `tsconfig.json` file is only used for API Extractor, and by VSCode to provide type information. It is _not_ used to compile Puppeteer for shipping. Therefore we can specify `module: "esnext"` in here so that VSCode knows we can use all the latest and greatest module features (primarily, dynamic imports). In `tsconfig.cjs.json` and `tsconfig.esm.json` we set the `module` setting for CJS/ESM respectively.