class Playwright::Page::ScreenshotOptions

Included Modules

Defined in:

playwright/page.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(path : Path | Nil = nil, type : Playwright::Page::ScreenshotOptions::Type | Nil = nil, quality : Int32 | Nil = nil, full_page : Bool | Nil = nil, clip : Nil | Playwright::Page::ScreenshotOptions::Clip = nil, omit_background : Bool | Nil = nil, timeout : Int32 | Nil = nil) #

[View source]

Instance Method Detail

def clip : Clip | Nil #

An object which specifies clipping of the resulting image. Should have the following fields:


[View source]
def clip=(clip : Clip | Nil) #

An object which specifies clipping of the resulting image. Should have the following fields:


[View source]
def full_page : Bool | Nil #

When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to false.


[View source]
def full_page=(full_page : Bool | Nil) #

When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to false.


[View source]
def omit_background : Bool | Nil #

Hides default white background and allows capturing screenshots with transparency. Not applicable to jpeg images. Defaults to false.


[View source]
def omit_background=(omit_background : Bool | Nil) #

Hides default white background and allows capturing screenshots with transparency. Not applicable to jpeg images. Defaults to false.


[View source]
def path : Path | Nil #

The file path to save the image to. The screenshot type will be inferred from file extension. If #path is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.


[View source]
def path=(path : Path | Nil) #

The file path to save the image to. The screenshot type will be inferred from file extension. If #path is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.


[View source]
def quality : Int32 | Nil #

The quality of the image, between 0-100. Not applicable to png images.


[View source]
def quality=(quality : Int32 | Nil) #

The quality of the image, between 0-100. Not applicable to png images.


[View source]
def timeout : Int32 | Nil #

Maximum time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.


[View source]
def timeout=(timeout : Int32 | Nil) #

Maximum time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.


[View source]
def type : Type | Nil #

Specify screenshot type, defaults to png.


[View source]
def type=(type : Type | Nil) #

Specify screenshot type, defaults to png.


[View source]