Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/playwright_ex/channels/browser_context.ex
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ defmodule PlaywrightEx.BrowserContext do
@schema schema
@type close_opt :: unquote(NimbleOptions.option_typespec(schema))
@spec close(PlaywrightEx.guid(), [close_opt() | PlaywrightEx.unknown_opt()]) :: {:ok, any()} | {:error, any()}
def close(browser_id, opts \\ []) do
def close(context_id, opts \\ []) do
{connection, opts} = opts |> PlaywrightEx.Channel.validate_known!(@schema) |> Keyword.pop!(:connection)
{timeout, opts} = Keyword.pop!(opts, :timeout)

connection
|> Connection.send(%{guid: browser_id, method: :close, params: Map.new(opts)}, timeout)
|> Connection.send(%{guid: context_id, method: :close, params: Map.new(opts)}, timeout)
|> ChannelResponse.unwrap(& &1)
end

Expand Down
Loading