<!--
{
  "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/openTabs",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKWebExtensionContext(py)openTabs"
  },
  "title" : "openTabs"
}
-->

# openTabs

A set of open tabs in all open windows that are exposed to this extension.

```
var openTabs: Set<AnyHashable> { get }
```

## Discussion

Provides a set of tabs in all open windows that are visible to the extension, as updated by the [`didOpenTab(_:)`](/documentation/WebKit/WKWebExtensionContext/didOpenTab(_:)) and [`didCloseTab:windowIsClosing:`](/documentation/WebKit/WKWebExtensionContext/didCloseTab:windowIsClosing:) methods.

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

## See Also

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

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

[`didCloseTab:windowIsClosing:`](/documentation/WebKit/WKWebExtensionContext/didCloseTab:windowIsClosing:)

Called by the app when a tab 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)