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

# hasRequestedOptionalAccessToAllHosts

A Boolean value indicating if the extension has requested optional access to all hosts.

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

## Discussion

If this property is `YES`, the extension has asked for access to all hosts in a call to `browser.runtime.permissions.request()`, and future permission checks will present discrete hosts for approval as being implicitly requested. This value should be saved and restored as needed by the app.

---

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)