Skip to content

Commit

Permalink
[java] Revert workaround for old netty http client (addendum to Selen…
Browse files Browse the repository at this point in the history
…iumHQ#12843)

Workaround was made as part of the fix (3f7f57c) the bug SeleniumHQ#11750 which was specific for netty client only.
Since SeleniumHQ#12843 the netty client was removed.
  • Loading branch information
kool79 committed Jun 13, 2024
1 parent ce96b41 commit 49b0344
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions java/src/org/openqa/selenium/chromium/ChromiumOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,24 +120,12 @@ public T addArguments(String... arguments) {
* "allow-outdated-plugins");
* </code></pre>
*
* <p>Each argument may contain an option "--" prefix: "--foo" or "foo". Arguments with an
* <p>Each argument may contain an optional "--" prefix: "--foo" or "foo". Arguments with an
* associated value should be delimited with an "=": "foo=bar".
*
* @param arguments The arguments to use when starting Chrome.
*/
public T addArguments(List<String> arguments) {
/*
--remote-allow-origins is being added by default since Chrome 111. We need to check
if the argument already exists and then remove it.
*/
String remoteAllowOrigins = "remote-allow-origins";
Optional<String> newArg =
arguments.stream().filter(arg -> arg.contains(remoteAllowOrigins)).findFirst();
Optional<String> existingArg =
args.stream().filter(arg -> arg.contains(remoteAllowOrigins)).findFirst();
if (newArg.isPresent() && existingArg.isPresent()) {
args.remove(existingArg.get());
}
args.addAll(arguments);
return (T) this;
}
Expand Down

0 comments on commit 49b0344

Please sign in to comment.