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

# hasAccessToPrivateData

A Boolean value indicating if the extension has access to private data.

```
var hasAccessToPrivateData: Bool { get set }
```

## Discussion

If this property is <doc://com.apple.documentation/documentation/Swift/true>, the extension is granted permission to interact with private windows, tabs, and cookies. Access to private data should be explicitly allowed by the user before setting this property. This value should be saved and restored as needed by the app.

> Note: To ensure proper isolation between private and non-private data, web views associated with private data must use a different ``doc://com.apple.webkit/documentation/WebKit/WKUserContentController``. Likewise, to be identified as a private web view and to ensure that cookies and other website data is not shared, private web views must be configured to use a non-persistent ``doc://com.apple.webkit/documentation/WebKit/WKWebsiteDataStore``.

---

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)