Headless mode is meant to be used on computers without screens, so how does PhantomJS and HtmlUnit figure out the maximized size ?
Asked
Active
Viewed 422 times
1 Answers
1
For HtmlUnit the (default) values are in WebClientOptions
private int screenWidth_ = 1024;
private int screenHeight_ = 768;
You can change this to any value you like:
final WebClient webClient = new WebClient(BrowserVersion.BEST_SUPPORTED);
webClient.getOptions().setScreenWidth(640);
webClient.getOptions().setScreenHeight(480);

RBRi
- 2,704
- 2
- 11
- 14