idea: open browser window maximized
Hi,
I would like to open the Chrome browser window in a maximized way, i.e. it should fill the whole screen. As a temporary solution, I patched my splinter/driver/webdriver/chrome.py file by adding the following line:
options.add_argument("--start-maximized")
It would be nice to create a browser this way for instance:
options = ["--start-maximized"] br = Browser('chrome', options=options)
Best,
Laszlo
Hi Laszlo, In which scenario you missed this feature? How portable is it?
Thanks!
Hi,
I wanted to take a screenshot of a specific area of an opened webpage. If the window is opened maximized, this area is always at the same place so I can grab a fix area. If it's not maximized, the browser window is sometimes opened on the left, sometimes on the right, so in this case I had to locate the area that I wanted to grab. So the maximized window made everything much simpler for me.
I don't know how portable it is. What I wrote is specific for Chrome. I tried it under Linux.
Thanks and best wishes,
Laszlo
I see. I like the idea of being able to give extra options to the underlying driver.
I asked about portability because "maximize" is not the same thing on Mac OS X and Linux.
As far as I know, you can maximize the browser using the underlying driver:
br = splinter.Browser('chrome')
br.driver.maximize_window()
@Droogans it only works with no headless drivers based on webdriver. Like firefox and chrome.
+1 on adding support to pass options while creating a browser instance. I needed to pass --proxy-server and had to patch chrome.py
@sidhant can you paste your patch to me?
Since #494, you can pass options to the Browser instance.