pub struct ScreenshotBuilder {
inner: Weak<Page>,
args: ScreenshotArgs,
}Fields§
§inner: Weak<Page>§args: ScreenshotArgsImplementations§
Source§impl ScreenshotBuilder
impl ScreenshotBuilder
pub(crate) fn new(inner: Weak<Impl>) -> Self
pub async fn screenshot(self) -> Result<Vec<u8>, Arc<Error>>
pub fn type(self, x: ScreenshotType) -> Self
Sourcepub fn clip(self, x: FloatRect) -> Self
pub fn clip(self, x: FloatRect) -> Self
An object which specifies clipping of the resulting image. Should have the following fields:
Sourcepub fn full_page(self, x: bool) -> Self
pub fn full_page(self, x: bool) -> Self
When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to
false.
Sourcepub fn omit_background(self, x: bool) -> Self
pub fn omit_background(self, x: bool) -> Self
Hides default white background and allows capturing screenshots with transparency. Not applicable to jpeg images.
Defaults to false.
pub fn quality(self, x: i32) -> Self
Sourcepub fn timeout(self, x: f64) -> Self
pub fn timeout(self, x: f64) -> Self
Maximum time in milliseconds, defaults to 30 seconds, pass 0 to disable timeout. The default value can be changed by
using the [method: BrowserContext.setDefaultTimeout] or [method: Page.setDefaultTimeout] methods.
Sourcepub fn path(self, x: PathBuf) -> Self
pub fn path(self, x: PathBuf) -> Self
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.