mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Fallback to fullpage when page dimensions arent available
This commit is contained in:
@@ -140,7 +140,9 @@ export class UrlContentFetcher {
|
||||
}
|
||||
})
|
||||
// const defaultViewport = this.page.viewport(); // width 800 height 600 by default
|
||||
let options: ScreenshotOptions = {
|
||||
let options: ScreenshotOptions
|
||||
if (pageHeight && pageWidth) {
|
||||
options = {
|
||||
// fullPage: true, // clip and fullPage are mutually exclusive
|
||||
encoding: "base64",
|
||||
// quality: 80,
|
||||
@@ -151,6 +153,13 @@ export class UrlContentFetcher {
|
||||
height: Math.min(pageHeight, 8_000),
|
||||
},
|
||||
}
|
||||
} else {
|
||||
// if we can't get the page dimensions, fallback to full page screenshot
|
||||
options = {
|
||||
encoding: "base64",
|
||||
fullPage: true,
|
||||
}
|
||||
}
|
||||
|
||||
let screenshotBase64 = await this.page.screenshot({
|
||||
...options,
|
||||
|
||||
Reference in New Issue
Block a user