Unable to set fullscreen mode for chrome-headless on linux
Reported by
hkat...@redhat.com,
Jun 28 2017
|
||
Issue description
Chrome Version : 59.0.3071.104 (Official Build) (64-bit)
ChromeDriver Version : 2.30.477691
Platform : Linux 4.10.15-100.fc24.x86_64
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
Safari: -
Firefox: OK
IE: OK
What steps will reproduce the problem?
(1) Set dimensions/window-size using chromeOptions
(2) ChromeOptions chromeOptions = new ChromeOptions();
(3) chromeOptions.addArguments("--headless", "--start-fullscreen");
What is the expected result?
Should be able to resize browser window to fullscreen mode
What happens instead?
Fails to resize and open chrome in fullscreen/maximized view.
Please provide any additional information below. Attach a screenshot if
possible.
Also tried workarounds, like using argument "--start-maximized" and "--kiosk" but same issue.
Works by setting "--window-size=width,height" but not for fullscreen mode.
,
Jun 28 2017
Yes, I would expect to be able to use --start-fullscreen/--start-maximized. Setting --window-size poses a limitation of fixing values for width and height which could change across platforms and systems. So, I expect be a more generic way, to enable fullscreen/maximized window mode as also described in the document, https://sites.google.com/a/chromium.org/chromedriver/capabilities.
,
Jun 28 2017
--start-fullscreen could have some standard or maximized size to start and set chrome unless otherwise explicitly specified by the user.
,
Jun 28 2017
Relating to issue https://bugs.chromium.org/p/chromedriver/issues/detail?id=985 for linux platform.
,
Jun 28 2017
Well, the default window size and display size in headless mode is 800x600 on all platforms, so I'm not sure what difference --start-fullscreen or --start-maximized would make.
,
Jun 28 2017
What I am expecting is being able to open chrome browser window to maximized/fullscreen(i.e. have a browser window size equivalent to my screen size such that my webpage opens and covers up full screen and not just part of the screen) irrespective of the platform or system I use. That is what I think, "--start-maximized" is intended to do as mentioned here, https://sites.google.com/a/chromium.org/chromedriver/capabilities, if I am not wrong.
,
Jun 28 2017
Sorry, I'm still confused. In headless mode nothing will show up on the screen, so there's really no concept of "fullscreen" there.
,
Jun 28 2017
I am trying to do something similar to this, https://stackoverflow.com/questions/43541925/how-to-set-the-browser-window-size-when-using-google-chrome-headless?rq=1. The solution provided here works for me, but rather than setting `window-size=1920x1080`, I would rather prefer something more generic like `window-size=maximized` or `window-size=fullscreen`. Something on these lines, if you get my point. So, I assume I should be able to achieve this using the available chromeOption `start-maximized`.
,
Jun 28 2017
The problem is that headless mode is meant to be used on computers without screens, so there's no way for it to figure out what size your screen is even if you have one. The only way is for you to pass that information to the browser with --window-size.
,
Jul 4 2017
Given the information we have here I don't think there's anything we need to change in the current implementation. Let me know if I've missed something.
,
Jul 4 2017
Thanks for the information, was expecting an implementation similar to how it is handled for other headless browsers like PhantomJs, which handles this by setting an additional meaningful default other than the usual default for the maximize screen.
,
Jul 4 2017
My issue is resolved by explicitly handling this case. Thanks |
||
►
Sign in to add a comment |
||
Comment 1 by skyos...@chromium.org
, Jun 28 2017