# `Playwright.Disposable`
[🔗](https://github.com/ftes/playwright_ex/blob/v1.65.0-rc.3/lib/playwright/api/disposable.ex#L7)

[`Disposable`](`Playwright.Disposable`) is returned from various methods to allow undoing the corresponding action. For example,
`Playwright.Page.add_init_script/4` returns a [`Disposable`](`Playwright.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}`).

# `t`

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

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

# `dispose`

```elixir
@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!`

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

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
