searchInResource method

Future<List<SearchMatch>> searchInResource(
  1. FrameId frameId,
  2. String url,
  3. String query, {
  4. bool? caseSensitive,
  5. bool? isRegex,
})

Searches for given string in resource content. frameId Frame id for resource to search in. url URL of the resource to search in. query String to search for. caseSensitive If true, search is case sensitive. isRegex If true, treats string parameter as regex. Returns: List of search matches.

Implementation

Future<List<debugger.SearchMatch>> searchInResource(
  FrameId frameId,
  String url,
  String query, {
  bool? caseSensitive,
  bool? isRegex,
}) async {
  var result = await _client.send('Page.searchInResource', {
    'frameId': frameId,
    'url': url,
    'query': query,
    if (caseSensitive != null) 'caseSensitive': caseSensitive,
    if (isRegex != null) 'isRegex': isRegex,
  });
  return (result['result'] as List)
      .map((e) => debugger.SearchMatch.fromJson(e as Map<String, dynamic>))
      .toList();
}