<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "BrowserEngineKit",
  "identifier" : "/documentation/BrowserEngineKit/BEWebContentFilter/evaluateURL(_:mainFrameURL:isMainFrame:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BrowserEngineKit"
    ],
    "preciseIdentifier" : "c:objc(cs)BEWebContentFilter(im)evaluateURL:mainFrameURL:isMainFrame:completionHandler:"
  },
  "title" : "evaluateURL(_:mainFrameURL:isMainFrame:completionHandler:)"
}
-->

# evaluateURL(_:mainFrameURL:isMainFrame:completionHandler:)

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

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

## Parameters

`url`

The URL to be evaluated, either a main frame or subframe URL.

`mainFrameURL`

The URL of the main document and root of the transitive trust
policy. This may match the evaluated `url` param for main frame navigations.

`isMainFrame`

Whether the evaluated URL is a main frame or subframe navigation.
YES if main frame navigation and NO otherwise.

`completionHandler`

The completion block to be invoked when evaluation is
complete.

## Discussion\abstract Evaluates whether a URL should be blocked and if yes, provides a
response body representing the HTML of the blocking content that will be displayed
in either the blocked main document or blocked subframe.

---

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)