<!--
{
  "availability" : [
    "iOS: 18.4.0 -",
    "iPadOS: 18.4.0 -",
    "macCatalyst: 18.4.0 -",
    "macOS: 15.4.0 -",
    "visionOS: 2.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKWebExtensionController/fetchDataRecords(ofTypes:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKWebExtensionController(im)fetchDataRecordsOfTypes:completionHandler:"
  },
  "title" : "fetchDataRecords(ofTypes:completionHandler:)"
}
-->

# fetchDataRecords(ofTypes:completionHandler:)

Fetches data records containing the given extension data types for all known extensions.

```
func fetchDataRecords(ofTypes dataTypes: Set<WKWebExtension.DataType>, completionHandler: @escaping ([WKWebExtension.DataRecord]) -> Void)
```

## Parameters

`dataTypes`

The extension data types to fetch records for.

`completionHandler`

A block to invoke when the data records have been fetched.

## Discussion> Note: The extension does not need to be loaded to be included in the result.

---

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)