---
title: "setMuted(_:for:completionHandler:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensiontab/setmuted(_:for:completionhandler:)"
---

# setMuted(_:for:completionHandler:)

Called to set the mute state of the tab.

## Declaration

```swift
optional func setMuted(_ muted: Bool, for context: WKWebExtensionContext, completionHandler: @escaping ((any Error)?) -> Void)
```

```swift
optional func setMuted(_ muted: Bool, for context: WKWebExtensionContext) async throws
```

## Parameters

- `muted`: A boolean indicating whether the tab should be muted.
- `context`: The context in which the web extension is running.
- `completionHandler`: A block that must be called upon completion. It takes a single error argument, which should be provided if any errors occurred.

## Discussion

Discussion No action is performed if not implemented.

## See Also

### Related Documentation

- [isMuted(for:)](webkit/wkwebextensiontab/ismuted(for:).md)
