<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKImmersiveEnvironmentDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WKImmersiveEnvironmentDelegate"
  },
  "title" : "WKImmersiveEnvironmentDelegate"
}
-->

# WKImmersiveEnvironmentDelegate

```
@MainActor protocol WKImmersiveEnvironmentDelegate : NSObjectProtocol
```

## Overview\abstract A protocol for managing immersive environment presentation in a web view.
\discussion Implement the methods of this protocol to control authorization, presentation,
and dismissal of immersive environments requested by websites.

## Topics

### Instance Methods

[`func webView(WKWebView, dismiss: WKImmersiveEnvironment, completionHandler: () -> Void)`](/documentation/WebKit/WKImmersiveEnvironmentDelegate/webView(_:dismiss:completionHandler:))

[`func webView(WKWebView, present: WKImmersiveEnvironment, completionHandler: ((any Error)?) -> Void)`](/documentation/WebKit/WKImmersiveEnvironmentDelegate/webView(_:present:completionHandler:))

[`func webView(WKWebView, shouldAllowImmersiveEnvironmentFromFrame: WKFrameInfo, completionHandler: (Bool) -> Void)`](/documentation/WebKit/WKImmersiveEnvironmentDelegate/webView(_:shouldAllowImmersiveEnvironmentFromFrame:completionHandler:))

## Relationships

### Inherits From

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

---

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)