Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/astral/src/browser.ts>Browser

A high-level puppeteer/playwright-like library for Deno
Latest
class Browser
import { Browser } from "https://deno.land/x/astral@0.3.5/src/browser.ts";

The browser class is instantiated when you run the launch method.

Examples

Example 1

const browser = await launch();

Constructors

new
Browser(
process: Deno.ChildProcess | null,
)

Properties

readonly
closed: boolean

Returns true if the browser and its websocket have benn closed

readonly
isRemoteConnection: boolean

Returns true if browser is connected remotely instead of using a subprocess

readonly
pages: Page[]

Methods

Closes the browser and all of its pages (if any were opened). The Browser object itself is considered to be disposed and cannot be used anymore.

newPage(url?: string, options?: WaitForOptions & SandboxOptions): Promise<Page>

Promise which resolves to a new Page object.

userAgent(): Promise<string>

The browser's original user agent.

version(): Promise<string>

A string representing the browser name and version.

wsEndpoint(): string

The browser's websocket endpoint