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

# webViewConfiguration

The web view configuration to use for web views that load pages from this extension.

```
@NSCopying var webViewConfiguration: WKWebViewConfiguration? { get }
```

## Discussion

Returns a customized copy of the configuration, originally set in the web extension controller configuration, for this extension.

The app must use this configuration when initializing web views intended to navigate to a URL originating from this extension’s base URL.

The app must also swap web views in tabs when navigating to and from web extension URLs. This property returns `nil` if the context isn’t associated with a web extension controller. The returned configuration copy can be customized prior to web view initialization.

> Note: Navigations will fail if a web view using this configuration attempts to navigate to a URL that doesn’t originate from this extension’s base URL. Similarly, navigations will be canceled if a web view not configured with this configuration attempts to navigate to a URL that does originate from this extension’s base URL.

---

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)