lighthouse
lighthouse copied to clipboard
core(full-page-screenshot): disable `fromSurface`
https://github.com/GoogleChrome/lighthouse/pull/14656#discussion_r1065200023
I was seeing screenshot size reduction of ~5-10KB.
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.
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.
@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.