Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: browser

[11:14] (extern: com.lehman.aussom.ABrowser) extends: object

The browser class represents a launched browser instance (Chromium, Firefox, or WebKit). Instances are obtained by calling browsertype.launch() or browsertype.launchHeadless(). Each browser may own multiple browser contexts. Call close() when done to release resources.

Methods

  • newPage ()

    Creates a new page in a new browser context and returns it. This is a convenience method equivalent to newContext().newPage().

    • @r A new page object.
  • newContext ()

    Creates a new isolated browser context within this browser. Each context has its own cookies, local storage, and permissions.

    • @r A new browsercontext object.
  • close ()

    Closes the browser and all of its pages and contexts.

    • @r This object.
  • version ()

    Returns the browser version string as reported by the browser.

    • @r A string with the browser version (e.g. "120.0.6099.71").
  • isConnected ()

    Returns whether the browser process is currently connected and alive.

    • @r A bool - true if the browser is connected.
  • contexts ()

    Returns a list of all open browser contexts owned by this browser.

    • @r A list of browsercontext objects.
  • browserType ()

    Returns the browser type that was used to launch this browser instance.

    • @r A browsertype object.