---
title: "evaluateURL(_:completionHandler:)"
framework: browserenginekit
role: symbol
role_heading: Instance Method
path: "browserenginekit/bewebcontentfilter/evaluateurl(_:completionhandler:)"
---

# evaluateURL(_:completionHandler:)

Determines whether to block a URL.

## Declaration

```swift
func evaluateURL(_ url: URL, completionHandler: @escaping @Sendable (Bool, Data?) -> Void)
```

```swift
func evaluateURL(_ url: URL) async -> (Bool, Data?)
```

## Parameters

- `url`: The URL to evaluate.
- `completionHandler`: A closure that the system invokes when URL evaluation finishes. The closure returns true if the URL is blocked; false, otherwise.

## Discussion

Discussion If this method blocks a URL, it returns a UTF-8 encoded HTML representation of a blocking page. This method performs a lazy initialization of some objects, so the first call can take longer than subsequent calls.

## See Also

### Evaluating URLs

- [shouldEvaluateURLs](browserenginekit/bewebcontentfilter/shouldevaluateurls.md)
