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

# didCloseWindow(_:)

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

## Declaration

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

## Parameters

- `closedWindow`: The window that was closed.

## Discussion

Discussion This method informs only the specific extension of the closure of a window. 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

- [didOpenWindow(_:)](webkit/wkwebextensioncontext/didopenwindow(_:).md)
- [openWindows](webkit/wkwebextensioncontext/openwindows.md)
