6474edb9ba
This pulls in the types (based on the DefinitelyTyped repo) for `page.$eval` (and the `$eval` method on other classes). The `$eval` method is quite hard to type due to the way we wrap and unwrap ElementHandles that are passed to / returned from the `pageFunction` that users provide. Longer term we can improve the types by providing type overloads as DefinitelyTyped does but I've deferred that for now (see the `TODO` in the code for more details).
8.0 KiB
8.0 KiB
puppeteer package
Classes
Class | Description |
---|---|
Accessibility | The Accessibility class provides methods for inspecting Chromium's accessibility tree. The accessibility tree is used by assistive technology such as screen readers or switches. |
Browser | A Browser is created when Puppeteer connects to a Chromium instance, either through Puppeteer.launch() or Puppeteer.connect(). |
BrowserContext | BrowserContexts provide a way to operate multiple independent browser sessions. When a browser is launched, it has a single BrowserContext used by default. The method Browser.newPage creates a page in the default browser context. |
BrowserFetcher | BrowserFetcher can download and manage different versions of Chromium and Firefox. |
CDPSession | The CDPSession instances are used to talk raw Chrome Devtools Protocol. |
Connection | |
ConsoleMessage | ConsoleMessage objects are dispatched by page via the 'console' event. |
Coverage | The Coverage class provides methods to gathers information about parts of JavaScript and CSS that were used by the page. |
Dialog | Dialog instances are dispatched by the Page via the dialog event. |
ElementHandle | ElementHandle represents an in-page DOM element. |
EventEmitter | The EventEmitter class that many Puppeteer classes extend. |
ExecutionContext | This class represents a context for JavaScript execution. A [Page] might have many execution contexts: - each frame has "default" execution context that is always created after frame is attached to DOM. This context is returned by the method. - Extension's content scripts create additional execution contexts.Besides pages, execution contexts can be found in workers. |
FileChooser | File choosers let you react to the page requesting for a file. |
Frame | |
FrameManager | |
HTTPRequest | |
HTTPResponse | The HTTPResponse class represents responses which are received by the Page class. |
JSHandle | Represents an in-page JavaScript object. JSHandles can be created with the page.evaluateHandle method. |
Keyboard | Keyboard provides an api for managing a virtual keyboard. The high level api is Keyboard.type(), which takes raw characters and generates proper keydown, keypress/input, and keyup events on your page. |
Mouse | The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport. |
Page | Page provides methods to interact with a single tab or [extension background page](https://developer.chrome.com/extensions/background_pages) in Chromium. One [Browser] instance might have multiple [Page] instances. |
Puppeteer | The main Puppeteer class Puppeteer module provides a method to launch a browser instance. |
SecurityDetails | The SecurityDetails class represents the security details of a response that was received over a secure connection. |
Target | |
TimeoutError | TimeoutError is emitted whenever certain operations are terminated due to timeout. |
Touchscreen | The Touchscreen class exposes touchscreen events. |
Tracing | The Tracing class exposes the tracing audit interface. |
WebWorker | The WebWorker class represents a WebWorker. |
Enumerations
Enumeration | Description |
---|---|
PageEmittedEvents | All the events that a page instance may emit. |
Interfaces
Interface | Description |
---|---|
BoundingBox | |
BoxModel | |
BrowserFetcherOptions | |
ClickOptions | |
ConsoleMessageLocation | |
CoverageEntry | The CoverageEntry class represents one entry of the coverage report. |
CSSCoverageOptions | Set of configurable options for CSS coverage. |
GeolocationOptions | |
JSCoverageOptions | Set of configurable options for JS coverage. |
JSONObject | |
KeyDefinition | Copyright 2017 Google Inc. All rights reserved.Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
Metrics | |
PressOptions | |
RemoteAddress | |
SerializedAXNode | Represents a Node and the properties of it that are relevant to Accessibility. |
SnapshotOptions | |
WaitForOptions | |
WaitForTargetOptions | |
WaitTimeoutOptions |
Variables
Variable | Description |
---|---|
EVALUATION_SCRIPT_URL | |
keyDefinitions | |
puppeteerErrors |
Type Aliases
Type Alias | Description |
---|---|
ConsoleMessageType | The supported types for console messages. |
EvaluateFn | |
EvaluateFnReturnType | |
EvaluateHandleFn | |
JSONArray | |
KeyInput | |
MouseButtonInput | |
PuppeteerErrors | |
Serializable | |
SerializableOrJSHandle | |
UnwrapElementHandle | Unwraps a DOM element out of an ElementHandle instance |
WrapElementHandle | Wraps a DOM element into an ElementHandle instance |