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

# didCloseTab(_:windowIsClosing:)

Should be called by the app when a tab is closed to fire appropriate events with all loaded web extensions.

## 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 all loaded extensions of the closing of a tab, ensuring consistent understanding across extensions. If the intention is to inform only a specific extension, you should use the respective method on that extension’s context instead.

## See Also

### Related Documentation

- [didOpenTab(_:)](webkit/wkwebextensioncontroller/didopentab(_:).md)
