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

# setZoomFactor(_:for:completionHandler:)

Called to set the zoom factor of the tab.

## Declaration

```swift
optional func setZoomFactor(_ zoomFactor: Double, for context: WKWebExtensionContext, completionHandler: @escaping ((any Error)?) -> Void)
```

```swift
optional func setZoomFactor(_ zoomFactor: Double, for context: WKWebExtensionContext) async throws
```

## Parameters

- `zoomFactor`: The desired zoom factor for the tab.
- `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 Sets pageZoom of the tab’s web view if not implemented.

## See Also

### Related Documentation

- [zoomFactor(for:)](webkit/wkwebextensiontab/zoomfactor(for:).md)
