---
title: "isSelected(for:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensiontab/isselected(for:)"
---

# isSelected(for:)

Called when the selected state of the tab is needed.

## Declaration

```swift
optional func isSelected(for context: WKWebExtensionContext) -> Bool
```

## Parameters

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

## Discussion

Discussion Defaults to YES for the active tab and NO for other tabs if not implemented.
