Skip to content

Function: createBackgroundPage()

ts
function createBackgroundPage(
   ctx: Context, 
   url?: string, 
options?: GoToOptions): Promise<Context>;

Defined in: src/pages/index.ts:168

Create a background browser tab that opens minimized.

Parameters

ParameterTypeDescription
ctxContextThe current Context.
url?stringURL to open. Defaults to https://www.google.com/ for extension pages.
options?GoToOptionsOptional Puppeteer GoToOptions.

Returns

Promise<Context>

A new Context scoped to the background tab.

Remarks

The tab opens in a minimized window of the same browser as ctx. For extension pages the default URL is https://www.google.com/.

Example

ts
const reportCtx = await createBackgroundPage(ctx, 'https://reports.megacorp.com/quarterly');
await waitForSelector(reportCtx, 'table#revenue-summary');

Matterway Assistant SDK Documentation