Playwright.Disposable (Playwright v1.65.0-rc.3)

Copy Markdown View Source

Disposable is returned from various methods to allow undoing the corresponding action. For example, Playwright.Page.add_init_script/4 returns a Disposable that can be used to remove the init script.

Since Playwright 1.59.

The examples alias the modules they use (alias Playwright.{Locator, Page}).

Summary

Types

t()

A Disposable handle. Compare handles with ==, their fields are internal.

Functions

Removes the associated resource. For example, removes the init script installed via Playwright.Page.add_init_script/4 or Playwright.BrowserContext.add_init_script/4.

Like dispose/1, but returns the value and raises on error.

Types

t()

@type t() :: %Playwright.Disposable{
  conn: term(),
  guid: term(),
  initializer: term(),
  table: term(),
  type: term()
}

A Disposable handle. Compare handles with ==, their fields are internal.

Functions

dispose(disposable)

@spec dispose(t()) :: :ok | {:error, Playwright.error()}

Removes the associated resource. For example, removes the init script installed via Playwright.Page.add_init_script/4 or Playwright.BrowserContext.add_init_script/4.

Since Playwright 1.59.

dispose!(disposable)

@spec dispose!(t()) :: :ok

Like dispose/1, but returns the value and raises on error.