<!--
{
  "availability" : [
    "iOS: 18.4.0 -",
    "iPadOS: 18.4.0 -",
    "macCatalyst: 18.4.0 -",
    "macOS: 15.4.0 -",
    "visionOS: 2.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKWebExtensionContext/openWindows",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKWebExtensionContext(py)openWindows"
  },
  "title" : "openWindows"
}
-->

# openWindows

The open windows that are exposed to this extension.

```
var openWindows: [any WKWebExtensionWindow] { get }
```

## Discussion

Provides the windows that are open and visible to the extension, as updated by the [`didOpenWindow(_:)`](/documentation/WebKit/WKWebExtensionContext/didOpenWindow(_:)) and [`didCloseWindow(_:)`](/documentation/WebKit/WKWebExtensionContext/didCloseWindow(_:)) methods.

Initially populated by the windows returned by the extension controller delegate method [`webExtensionController(_:openWindowsFor:)`](/documentation/WebKit/WKWebExtensionControllerDelegate/webExtensionController(_:openWindowsFor:)).

## See Also

[`didOpenWindow(_:)`](/documentation/WebKit/WKWebExtensionContext/didOpenWindow(_:))

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

[`didCloseWindow(_:)`](/documentation/WebKit/WKWebExtensionContext/didCloseWindow(_:))

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



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)