Doing some web crawling.
Can someone please explain to me, what the difference is, if any, between:
- Using the window-size argument when the headless chrome is instantiated:
--window-size=${width},${height}
vs
- Setting the viewport
page.setViewport({width,height});
--
I want to know whether there is any advantage to using the 1st method, over the second.
For example, in the eyes of the host, if I use a semi random width/height (ie select from a list of plausible values), will the first offer me any entropic advantage in the same way as selecting a random user agent does?
The second method, 'setViewport' method, is that simply a client side thing for rendering the actual page in the event that one wants to get a screenshot?, or, does it also notify/provide sufficient information to the host as to the nature of my virtual computers resolution ...
Many thanks.
NH
You could consider
--window-size=${width},${height}as the initial viewport.The good thing about
setViewportis that you can change the viewPort many times. It also overrides the window size. For instance, in this image, you can see that the viewport is set to 800x800 and it won't change no matter the size of the window.I think
setViewportwill give you more flexibility, and I would consider more stable , because it guarantees that the value you set will be honored.