---
title: "activeTab(for:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensionwindow/activetab(for:)"
---

# activeTab(for:)

Called when the active tab is needed for the window.

## Declaration

```swift
optional func activeTab(for context: WKWebExtensionContext) -> (any WKWebExtensionTab)?
```

## Parameters

- `context`: The context in which the web extension is running.

## Discussion

Discussion Defaults to nil if not implemented.
