Closed fimdomeio closed 7 years ago
on further investigation this appears to be risizeing the html document window but not the browser window.
Yup, can verify. Appears to be a shortcoming of the Chrome devtools protocol. Seems that resizing prior to navigating works for a quick fix until i find a more robust solution
Seems the sites that are most vulnerable to this are those that aren't responsive. @fimdomeio is there a site I can test against that more acutely exhibits this behavior?
I detected this on a site I'm developing so it's not publicly available. But I can confirm the same behavior on google.com.
Yeah, google.com seems to have issues, but https://www.chromestatus.com/features seems to work. (Make sure your on Canary)
If you're up for it, there's a beta build up navalia@0.0.10-0
. Try something like this script:
// npm i --save navalia@0.0.10-0
const { Chrome } = require('navalia');
const chrome = new Chrome();
chrome.goto('https://www.chromestatus.com/')
.then(() => chrome.screenshot('/Users/jgriffith/Downloads/google.png')) // Change filepath here
.then(() => chrome.done());
Hello. Did not have the time to test extensively but it seems to be fixed when using Chrome Canary on the latest version of your code.
Very good. I'll make sure to broadcast this in the docs
this happens when using setWindowSize. The only way I found to get around this is to insert an artificial waiting time (around 10s) or no to have the windows headeless and resizing by hand... as soon as it moves a pixel it re-renders the webpage and everything gets on the right place