allwright

API ReferenceTypeScriptBrowser

Browser

Launch a Chromium or Firefox session and hold the handle every other call goes through. Everything in the client is Promise-based — there's no sync/callback surface.

chromium / firefox

PropertySince v0.0.14

Pre-built launcher handles for the two supported browsers.

const chromium: BrowserType
const firefox: BrowserType

Example

import { firefox } from "@allwright.dev/core";
const browser = await firefox.launch();

BrowserType.launch

MethodSince v0.0.14

Launches a browser session of this type. launchChrome()/launchFirefox() are equivalent shortcuts.

launch(options?: LaunchOptions): Promise<Browser>

Browser.page

MethodSince v0.0.33

Returns the browser's initial page. initialPage()/initialTab() are aliases.

page(): Page

Example

const page = browser.page();

Browser.newPage

MethodSince v0.0.33

Opens and returns a new page in the same browser session. pages() lists every page tracked so far; newTab() is an alias.

newPage(options?: CommandOptions): Promise<Page>

Browser.close

MethodSince v0.0.14

Closes the browser session and disposes all its pages.

close(): Promise<void>

LaunchOptions

TypeSince v0.0.14

Launch-time options: a custom browser binary path and a launch timeout.

type LaunchOptions = {
  browserBinary?: string;
  timeoutMs?: number;
}