captureSnapshot method

Future<String> captureSnapshot({
  1. @Enum(['mhtml']) String? format,
})

Returns a snapshot of the page as a string. For MHTML format, the serialization includes iframes, shadow DOM, external resources, and element-inline styles. format Format (defaults to mhtml). Returns: Serialized page data.

Implementation

Future<String> captureSnapshot({@Enum(['mhtml']) String? format}) async {
  assert(format == null || const ['mhtml'].contains(format));
  var result = await _client.send('Page.captureSnapshot', {
    if (format != null) 'format': format,
  });
  return result['data'] as String;
}