CaptureScreenshotParameters

Represents the optional parameters for capturing a screenshot. Described in https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot.

Constructor

new CaptureScreenshotParameters()

Methods

clipRectangle(clipRectangle) → {CaptureScreenshotParameters}

Sets the clip rectangle for capturing a screenshot.

Parameters:
NameTypeDescription
clipRectangleBoxClipRectangle | ElementClipRectangle

The clip rectangle to set.

Throws:

If the clipRectangle is not an instance of ClipRectangle.

Type
Error
Returns:
  • The current instance of the CaptureScreenshotParameters for chaining.
Type: 
CaptureScreenshotParameters

imageFormat(type, qualityopt) → {CaptureScreenshotParameters}

Sets the image format and quality for capturing a screenshot.

Parameters:
NameTypeAttributesDescription
typestring

The image format type.

qualitynumber<optional>

The image quality (optional).

Throws:

If the type is not a string or if the quality is not a number.

Type
Error
Returns:
  • The current instance of the CaptureScreenshotParameters for chaining.
Type: 
CaptureScreenshotParameters

origin(origin) → {CaptureScreenshotParameters}

Sets the origin for capturing the screenshot.

Parameters:
NameTypeDescription
originOrigin

The origin for capturing the screenshot. Must be one of Origin.VIEWPORT or Origin.DOCUMENT.

Throws:
  • If the provided origin is not valid.
Type
Error
Returns:
  • The current instance of the CaptureScreenshotParameters for chaining.
Type: 
CaptureScreenshotParameters