We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acd0ad9 commit 7592347Copy full SHA for 7592347
java/client/src/org/openqa/selenium/chrome/ChromeOptions.java
@@ -214,6 +214,15 @@ public ChromeOptions setUnhandledPromptBehaviour(UnexpectedAlertBehaviour behavi
214
return this;
215
}
216
217
+ public ChromeOptions setHeadless(boolean headless) {
218
+ args.remove("--headless");
219
+ if (headless) {
220
+ args.add("--headless");
221
+ args.add("--disable-gpu");
222
+ }
223
+ return this;
224
225
+
226
/**
227
* Returns DesiredCapabilities for Chrome with these options included as
228
* capabilities. This does not copy the options. Further changes will be
0 commit comments