# `Playwright.AbortController`
[🔗](https://github.com/ftes/playwright_ex/blob/v1.65.0-rc.3/lib/playwright/abort_controller.ex#L1)

The DOM `AbortController`: aborts the calls given its `signal/1` as `signal:` option.

    controller = Playwright.AbortController.new()
    signal = Playwright.AbortController.signal(controller)
    Task.start(fn -> Process.sleep(1000); Playwright.AbortController.abort(controller) end)
    {:error, %Playwright.AbortError{}} = Playwright.Locator.click(button, signal: signal, timeout: 0)

Any process can abort. The calls fail with `Playwright.AbortError`, whose
`cause` is the reason; matchers fail like a timeout ("The assertion was aborted").

Runtime support (not ported from upstream). A controller is global, as in JS: its signal works
with calls on any driver (see `Playwright.AbortSignal`).

# `t`

```elixir
@type t() :: %Playwright.AbortController{signal: Playwright.AbortSignal.t()}
```

An abort controller.

# `abort`

```elixir
@spec abort(t(), term()) :: :ok
```

`controller.abort(reason)`: aborts the signal, from any process; its listeners have run when it
returns (see `Playwright.AbortSignal`). Without a reason
(`nil`), the reason is an `AbortError` "This operation was aborted" (JS: a `DOMException` of that
name). Aborting twice does nothing.

# `new`

```elixir
@spec new() :: t()
```

`new AbortController()`.

# `signal`

```elixir
@spec signal(t()) :: Playwright.AbortSignal.t()
```

`controller.signal`.

---

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