Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core(full-page-screenshot): disable fromSurface #14669

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adamraine
Copy link
Member

#14656 (comment)

I was seeing screenshot size reduction of ~5-10KB.

@alexnj
Copy link
Member

alexnj commented Jan 12, 2023

Do you have more info on what this flag does? API doc says it's experimental and screenshot are taken from view vs. surface — what's the difference between the two?

Also found this security bug which I'm not sure is applicable while LH is running from within DevTools.

@adamraine
Copy link
Member Author

Do you have more info on what this flag does? API doc says it's experimental and screenshot are taken from view vs. surface — what's the difference between the two?

My understanding is that fromSurface: true will temporarily change how the size of the frame so that the screenshot will have a consistent size across different platforms. I don't know if we can guarantee that the image size will always be smaller with fromSurface: true, that was just the case with my mac and monitor.

This patch is giving up consistent screenshot sizes for screenshots that just capture whatever the browser is rendering without changing the frame size.

Also found this security bug which I'm not sure is applicable while LH is running from within DevTools.

I don't think this is applicable to us. Seems like it was to prevent third party extensions from capturing content outside the page.

@adamraine
Copy link
Member Author

@alexnj you do bring up a good point that we should develop a better understanding before we use the non-default option. I think I was initially scared about page content when the screenshot would make the frame bigger during a test, but it seems like it is just a temporary visual adjustment and doesn't actually affect page content. I also can't guarantee this will reduce image size in all cases, just my own device and monitor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants