Skip to main content
Version: Next

PuppeteerController

The BrowserController serves two purposes. First, it is the base class that specialized controllers like PuppeteerController or PlaywrightController extend. Second, it defines the public interface of the specialized classes which provide only private methods. Therefore, we do not keep documentation for the specialized classes, because it's the same for all of them.

Hierarchy

  • BrowserController<typeof Puppeteer, PuppeteerTypes.PuppeteerLaunchOptions, PuppeteerTypes.Browser, PuppeteerNewPageOptions>
    • PuppeteerController

Index

Constructors

constructor

  • Parameters

    • browserPlugin: BrowserPlugin<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>

    Returns PuppeteerController

Properties

inheritedactivePages

activePages: number = 0

inheritedbrowser

browser: Browser = ...

Browser representation of the underlying automation library.

inheritedbrowserPlugin

browserPlugin: BrowserPlugin<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>

The BrowserPlugin instance used to launch the browser.

inheritedid

id: string = ...

inheritedisActive

isActive: boolean = false

inheritedlastPageOpenedAt

lastPageOpenedAt: number = ...

inheritedlaunchContext

launchContext: LaunchContext<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page> = ...

The configuration the browser was launched with.

optionalinheritedproxyTier

proxyTier?: number

The proxy tier tied to this browser controller. undefined if no tiered proxy is used.

optionalinheritedproxyUrl

proxyUrl?: string

The proxy URL used by the browser controller. This is set every time the browser controller uses proxy (even the tiered one). undefined if no proxy is used

inheritedtotalPages

totalPages: number = 0

staticexternalinheriteddefaultMaxListeners

defaultMaxListeners: number

Methods

externalinheritedaddListener

  • addListener(event: U, listener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]): this
  • Parameters

    • externalevent: U
    • externallistener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]

    Returns this

inheritedclose

  • close(): Promise<void>
  • Gracefully closes the browser and makes sure there will be no lingering browser processes.

    Emits 'browserClosed' event.


    Returns Promise<void>

externalinheritedemit

  • emit(event: U, ...args: Parameters<BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]>): boolean
  • Parameters

    • externalevent: U
    • externalrest...args: Parameters<BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]>

    Returns boolean

externalinheritedeventNames

  • eventNames(): U[]
  • Returns U[]

inheritedgetCookies

  • getCookies(page: Page): Promise<Cookie[]>
  • Parameters

    • page: Page

    Returns Promise<Cookie[]>

externalinheritedgetMaxListeners

  • getMaxListeners(): number
  • Returns number

inheritedkill

  • kill(): Promise<void>
  • Immediately kills the browser process.

    Emits 'browserClosed' event.


    Returns Promise<void>

externalinheritedlistenerCount

  • listenerCount(type: BROWSER_CLOSED): number
  • Parameters

    • externaltype: BROWSER_CLOSED

    Returns number

externalinheritedlisteners

  • listeners(type: U): BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U][]
  • Parameters

    • externaltype: U

    Returns BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U][]

externalinheritedoff

  • off(event: U, listener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]): this
  • Parameters

    • externalevent: U
    • externallistener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]

    Returns this

externalinheritedon

  • on(event: U, listener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]): this
  • Parameters

    • externalevent: U
    • externallistener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]

    Returns this

externalinheritedonce

  • once(event: U, listener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]): this
  • Parameters

    • externalevent: U
    • externallistener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]

    Returns this

externalinheritedprependListener

  • prependListener(event: U, listener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]): this
  • Parameters

    • externalevent: U
    • externallistener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]

    Returns this

externalinheritedprependOnceListener

  • prependOnceListener(event: U, listener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]): this
  • Parameters

    • externalevent: U
    • externallistener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]

    Returns this

externalinheritedrawListeners

  • rawListeners(type: U): BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U][]
  • Parameters

    • externaltype: U

    Returns BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U][]

externalinheritedremoveAllListeners

  • removeAllListeners(event?: BROWSER_CLOSED): this
  • Parameters

    • externaloptionalevent: BROWSER_CLOSED

    Returns this

externalinheritedremoveListener

  • removeListener(event: U, listener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]): this
  • Parameters

    • externalevent: U
    • externallistener: BrowserControllerEvents<PuppeteerNode, PuppeteerLaunchOptions, Browser, PuppeteerNewPageOptions, Page>[U]

    Returns this

inheritedsetCookies

  • setCookies(page: Page, cookies: Cookie[]): Promise<void>
  • Parameters

    Returns Promise<void>

externalinheritedsetMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • externaln: number

    Returns this