Comments (9)
Cool, thank you for finding that. I will use the arguments then.
from chrome-headless-browser-docker.
Would passing "--window-size" to the chromeOptions args field works for you?
See: http://peter.sh/experiments/chromium-command-line-switches/
from chrome-headless-browser-docker.
Seems to manifest when there is a different version of chrome vs chromedriver. Is that possible in these dockerfiles?
from chrome-headless-browser-docker.
I tried locally on my machine, using latest stable chrome and chromedriver 2.9 worked correctly when trying to resize window. Maybe resizing relies on xvfb? not sure about the details on this container.
from chrome-headless-browser-docker.
Do you mind sharing a minimal set of code that could reproduce the issue?
from chrome-headless-browser-docker.
The code I wrote is in javascript (node)
var webdriver = require("selenium-webdriver");
function getRemoteBrowser() {
var activePlatform = {
"browserName": "chrome",
"deviceName": "chrome",
"platformName": "LINUX"
};
var browser = new webdriver.Builder()
.withCapabilities(activePlatform)
.usingServer('http://192.168.33.10:4444/wd/hub')
.build();
var driverWindow = driver.manage().window();
driverWindow.maximize() // here
return browser;
}
from chrome-headless-browser-docker.
According to https://bugs.chromium.org/p/chromedriver/issues/detail?id=1625#c39, headless mode does not support using extension to set the windows size, which seems to be what driver.manage().window().maximize() performed.
I believe that you can just use "--window-size" to set the dimension instead.
from chrome-headless-browser-docker.
"--window-size" not working either.
from chrome-headless-browser-docker.
Interesting. I am not able to reproduce it:
docker run --init -it --rm --name chrome --shm-size=1024m --cap-add=SYS_ADMIN \
--entrypoint=/usr/bin/google-chrome-unstable \
yukinying/chrome-headless-browser \
--headless --disable-gpu --window-size=200,300 \
--dump-dom http://howbigismybrowser.com/
And the result contains the correct dimension:
<div id="counter">
<span class="num">200</span>
<span id="divider"></span>
<span class="num">300</span>
</div>
from chrome-headless-browser-docker.
Related Issues (20)
- Pages not rendering with newest version of Chrome HOT 2
- error while loading shared libraries: libgconf-2.so.4 HOT 2
- Upgrade OS image and driver to latest version
- Provide a stable chrome version, too HOT 2
- How to access vagrant web server from the container? HOT 1
- Host header is specified and is not an IP address or localhost. HOT 12
- chrome crashed after the first round testing HOT 3
- Error During Build HOT 7
- cant pass parameters into the chrome drive for image: Chrome Headless Browser with Chrome Driver in Selenium HOT 1
- docker.for.mac.localhost not connecting from inspector HOT 3
- Debian stable is now bullseye HOT 4
- Image doesn't work on M1 Macs HOT 18
- WebGL disabled in chrome-headless-browser-stable image HOT 5
- E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied) HOT 1
- Container failing to boot HOT 4
- In CasaOS, there is a certain chance that it cannot be opened normally.
- Can't use with M2 Mac HOT 5
- Downloading files not working as expected HOT 7
- dbus errors when running chrome-headless-browser-stable (M2 Mac) HOT 1
- Unable to connect to chrome over websocket url HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrome-headless-browser-docker.