-
Notifications
You must be signed in to change notification settings - Fork 29
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
Screenshot dimensions differ in Chrome & Firefox #42
Comments
Hi! Selenium's screen capturing system is a mess. It accounts for the browser chrome, which differs in FF and Chrome. I've been meaning to work on this for a while now. What I'll do is to simply measure the exact amount of pixels FF and Chrome take, add those back to As a site note: one caveat is that for some reasons browser size can still varie ~5 pixels across different monitors. This pisses me off because it'll just invalidate the whole screenshot. But that's not too much of a problem if you use the same machine each time, e.g. with the remote recording option. The fact that Chrome doesn't capture the whole screen is is a known issue. I think Selenium's moving toward full-screen capture (IIRC FF used to have viewport screenshot taking capabilities but it got removed?). But currently, retaining an option for whole page recording, which doesn't work in Chrome, will just create additional mess, plus, I don't want to expose #36. Fortunately, scrolling is now recorded and played back correctly, so this will no longer be a problem. So based on that, I think the only logical solution is to always crop the screenshot to the viewport:
Tell me what you think! Btw I really dislike Selenium, but that's the only non-headless automatable solution I've found. |
I understand what you've written, and whilst I'd prefer a full screen capture option, if it can't be consistently provided, it's better to crop. If think you should first aim for a similar experience cross-browser. I wouldn't get too distracted by the exact pixel sizes, as users should never be comparing screenshots between browser, I wouldn't think. Agree about Selenium, btw! |
Boom! 0.7.0 in. Now the screenshots are all coherent. There shouldn't be any mismatch between your Closing this issue and leaving #36 open, just in case. |
Eh, just wanna notify you that 0.7.2 is out and fixes diff outputting bug. Please do upgrade! |
Hi,
Firstly, thanks for this Node port - I'm very excited about building Huxley into our workflow.
I've noticed that, in 0.6.1 and master alike, Firefox and Chrome do quite different things with screenshot dimensions:
Screensize 300x300
Chrome: 400x228, Firefox: 477x2665
Screensize 1000x600
Chrome: 1000x528, Firefox: 985x2584
Screensize 10000x10000
Chrome: 10000x898 (but image is 100% black), Firefox: 1665x1950
So, it seems that Chrome gets close to the specified dimensions. But it doesn't crop the image to the height of the content as I've seen suggested in other issues. Firefox, however, always seems to include the entire page and crops to the height of the content, ignoring the specified height, but getting kinda close on width.
I'm aware of this issue - facebookarchive/huxley#34 - in fact, i'm not bothered about the dimensions being a little off. However, it'd be really nice if the two browsers gave at least similar results, and if there was a way to grab the entire page in Chrome.
I've seen #36, but I would certainly like to retain an option for recording the whole page. Perhaps a wildcard or other specifier in the screenSize array?
The text was updated successfully, but these errors were encountered: