Playwright.BrowserContext (playwright v0.1.16-preview-2) View Source

Playwright.BrowserContext provides a way to operate multiple independent browser sessions.

If a page opens another page, e.g. with a window.open call, the popup will belong to the parent page's browser context.

Playwright allows creation of "incognito" browser contexts with the Playwright.Browser.new_context/1 function.

Link to this section Summary

Functions

Close the browser context. All the pages that belong to the browser context will be closed.

Create a new Playwright.Page in the browser context. If the context is "owned" by a Playwright.Page (i.e., was created as a side effect of Browser.new_page), raise an error because there should be a 1-to-1 mapping in that case.

Register a handler for various event types.

Link to this section Types

Specs

t() :: %Playwright.BrowserContext{
  browser: term(),
  connection: term(),
  guid: term(),
  initializer: term(),
  listeners: term(),
  owner_page: term(),
  parent: term(),
  type: term()
}

Link to this section Functions

Close the browser context. All the pages that belong to the browser context will be closed.

Create a new Playwright.Page in the browser context. If the context is "owned" by a Playwright.Page (i.e., was created as a side effect of Browser.new_page), raise an error because there should be a 1-to-1 mapping in that case.

Link to this function

on(subject, event, handler)

View Source

Register a handler for various event types.