Skip to content

Function: getPageFromContext()

ts
function getPageFromContext(ctx: Context): Promise<Page>;

Defined in: src/utils/pageAccess.ts:54

Get the Page object from a context. If the context wraps a Frame, return its parent Page.

Parameters

ParameterTypeDescription
ctxContextThe context object.

Returns

Promise<Page>

The resolved Page instance.

Example

ts
const page = await getPageFromContext(ctx);
await page.goto('https://example.com');

Matterway Assistant SDK Documentation