---
title: "didCloseWindow(_:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebextensioncontroller/didclosewindow(_:)"
---

# didCloseWindow(_:)

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

## Declaration

```swift
func didCloseWindow(_ closedWindow: any WKWebExtensionWindow)
```

## Discussion

Discussion closedWindow: The window that was closed. This method informs all loaded extensions of the closure of a window, 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

- [didOpenWindow(_:)](webkit/wkwebextensioncontroller/didopenwindow(_:).md)
