<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKContentWorld/Configuration",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKContentWorldConfiguration"
  },
  "title" : "WKContentWorld.Configuration"
}
-->

# WKContentWorld.Configuration

```
@MainActor class Configuration
```

## Overview\abstract A WKContentWorldConfiguration object allows you to specify custom behavior for a WKContentWorld instance.
\discussion WKContentWorldConfiguration allows applications to create WKContentWorld instances which have extra JavaScript
capabilities exposed to script in their environment. It does not change any default WebKit behaviors, nor change anything that web page
JavaScript can do. Only application JavaScript run in the created `WKContentWorld` will have different capabilities.

For example:

- If your scripts help provide autofill capabilities, you would want to set autofillEnabled to YES.

## Topics

### Initializers

[`init?(coder: NSCoder)`](/documentation/WebKit/WKContentWorld/Configuration/init(coder:))

### Instance Properties

[`var allowAccessingClosedShadowRoots: Bool`](/documentation/WebKit/WKContentWorld/Configuration/allowAccessingClosedShadowRoots)

[`var autofillScriptingEnabled: Bool`](/documentation/WebKit/WKContentWorld/Configuration/autofillScriptingEnabled)

[`var elementUserInfoEnabled: Bool`](/documentation/WebKit/WKContentWorld/Configuration/elementUserInfoEnabled)

[`var isInspectable: Bool`](/documentation/WebKit/WKContentWorld/Configuration/isInspectable)

[`var jsHandleCreationEnabled: Bool`](/documentation/WebKit/WKContentWorld/Configuration/jsHandleCreationEnabled)

[`var legacyBuiltinOverridesEnabled: Bool`](/documentation/WebKit/WKContentWorld/Configuration/legacyBuiltinOverridesEnabled)

[`var nodeSnapshotCreationEnabled: Bool`](/documentation/WebKit/WKContentWorld/Configuration/nodeSnapshotCreationEnabled)

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)