72fe86fe6a
This commit changes the internal representation of query handlers to contain Puppeteer-level code instead of page functions. The interface `CustomQueryHandler` is introduced for user-defined query handlers. When a `CustomQueryHandler` is registered using `registerCustomQueryHandler` a corresponding Puppeteer-level handler is created through `makeQueryHandler` by wrapping the page functions as appropriate. The internal query handlers (defined by the interface `QueryHandler`) contain two new functions: `waitFor` and `queryAllArray`. - `waitFor` allows page-based handlers to make use of the `WaitTask`-backed implementation in `DOMWorld`, whereas purely Puppeteer-based handlers can define an alternative approach instead. - `queryAllArray` is similar to `queryAll` but with a slightly different interface; it returns a `JSHandle` to an array with the results as opposed to an array of `ElementHandle`. It is used by `$$eval`. After this change, we can introduce built-in query handlers that are not executed in the page context (#6307). |
||
---|---|---|
.. | ||
common | ||
node | ||
.eslintrc.js | ||
api-docs-entry.ts | ||
environment.ts | ||
index-core.ts | ||
index.ts | ||
initialize.ts | ||
install.ts | ||
revisions.ts | ||
tsconfig.cjs.json | ||
tsconfig.esm.json |