feat(screenshot): add full-page screenshot support for iframes#685
feat(screenshot): add full-page screenshot support for iframes#685absarasw wants to merge 9 commits intoChromeDevTools:mainfrom
Conversation
|
cc @natorion wdyt? |
| 'If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid.', | ||
| 'If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid unless iframeUid is also provided.', | ||
| ), | ||
| iframeUid: zod |
There was a problem hiding this comment.
can this be done without introducing a new parameter? e.g., detect if uid points to an iframe element?
| responseMessage = "Took a screenshot of the current page's viewport."; | ||
| } | ||
|
|
||
| response.appendResponseLine(responseMessage); |
There was a problem hiding this comment.
would it be possible to add test coverage including local and out-of-process iframes?
I think this is fine, but the warning should be also highlight potential other issues, no? |
…for dashboard layouts, and simplified the API by removing iframeUid parameter—iframes are now auto-detected when uid + fullPage are used together. * Adding test coverage for scrollable containers, local iframes (auto-detection), and cross-origin iframe fallback behavior.
| context, | ||
| ); | ||
|
|
||
| assert.equal(response.images.length, 1); |
There was a problem hiding this comment.
is there a way to verify that the image is actually correct?
| * Takes a full-page screenshot of an iframe's content by temporarily | ||
| * expanding the iframe to show all scrollable content. | ||
| */ | ||
| async function takeIframeFullPageScreenshot( |
There was a problem hiding this comment.
This seems to change the iframe content to take the screenshot. I think we should find a way to do it with CDP to minimize the need for checking the content. Changing iframe styles might affect the content that is being screenshoted.
|
Closing the PR as stale. The FR affects the web content by changing its DOM using script execution. This is potentially very fragile and we won't accept it now. Please file a feature request if this is still relevant for your workflows so that we can re-prioritize and perhaps implement native CDP support for this. |
Add ability to capture full-page screenshots of iframe content by
temporarily expanding the iframe to reveal all scrollable content.
Changes:
iframeUidparameter to explicitly target an iframe for capturefullPage=trueis usedThis enables capturing complete iframe content (like embedded editors or
content frames) that would otherwise be clipped to the visible viewport.