---
title: "didCloseTab(_:windowIsClosing:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensioncontext/didclosetab(_:windowisclosing:)"
---

# didCloseTab(_:windowIsClosing:)

Called by the app when a tab is closed to fire appropriate events with only this extension.

## Declaration

```swift
@MainActor @preconcurrency func didCloseTab(_ closedTab: any WKWebExtensionTab, windowIsClosing: Bool = false)
```

## Parameters

- `closedTab`: The tab that was closed.
- `windowIsClosing`: A Boolean value indicating whether the window containing the tab is also closing.

## Discussion

Discussion This method informs only the specific extension of the closure of a tab. If the intention is to inform all loaded extensions consistently, you should use the respective method on the extension controller instead.

## See Also

### Related Documentation

- [didOpenTab(_:)](webkit/wkwebextensioncontext/didopentab(_:).md)
- [openTabs](webkit/wkwebextensioncontext/opentabs.md)
