getAffectedUrlsForThirdPartyCookieMetadata method

Future<List<String>> getAffectedUrlsForThirdPartyCookieMetadata(
  1. String firstPartyUrl,
  2. List<String> thirdPartyUrls
)

Returns the list of URLs from a page and its embedded resources that match existing grace period URL pattern rules. https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/grace-period firstPartyUrl The URL of the page currently being visited. thirdPartyUrls The list of embedded resource URLs from the page. Returns: Array of matching URLs. If there is a primary pattern match for the first- party URL, only the first-party URL is returned in the array.

Implementation

Future<List<String>> getAffectedUrlsForThirdPartyCookieMetadata(
  String firstPartyUrl,
  List<String> thirdPartyUrls,
) async {
  var result = await _client.send(
    'Storage.getAffectedUrlsForThirdPartyCookieMetadata',
    {
      'firstPartyUrl': firstPartyUrl,
      'thirdPartyUrls': [...thirdPartyUrls],
    },
  );
  return (result['matchedUrls'] as List).map((e) => e as String).toList();
}