---
title: "webView(_:shouldAllowImmersiveEnvironmentFromFrame:completionHandler:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkimmersiveenvironmentdelegate/webview(_:shouldallowimmersiveenvironmentfromframe:completionhandler:)"
---

# webView(_:shouldAllowImmersiveEnvironmentFromFrame:completionHandler:)

## Declaration

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

```swift
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

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