Saltar al contenido principal

Function: inPage()

function inPage<A, R>(
page,
fn,
arg
): Promise<R>;

Defined in: core/inPage.ts:9

Runs fn(arg) in the page, like page.evaluate, but with a __name helper defined first: tsx (the tests) compiles with esbuild's keepNames, which wraps named inner functions in __name(...) calls the page doesn't have (confirmed empirically). The bundle doesn't, and the helper is unused there. arg must be JSON.

Type Parameters​

Type Parameter
A
R

Parameters​

ParameterType
pagePage
fn(arg) => R | Promise<R>
argA

Returns​

Promise<R>