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

# webView(_:shouldAllowImmersiveEnvironmentFromFrame:completionHandler:)

```
func webView(_ webView: WKWebView, shouldAllowImmersiveEnvironmentFromFrame frame: WKFrameInfo, completionHandler: @escaping (Bool) -> Void)
```

```
func webView(_ webView: WKWebView, shouldAllowImmersiveEnvironmentFrom frame: WKFrameInfo) async -> Bool
```

## Parameters

`webView`

The web view that received the immersive environment request.

`frame`

The frame information from the website requesting the immersive environment.

`completionHandler`

The completion handler you must invoke with the request’s answer. `YES` to allow
the environment presentation, or `NO` to deny it.

## Discussion\abstract Asks the delegate whether to allow an immersive environment from the specified frame.

---

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)