diff --git a/java/src/org/openqa/selenium/chromium/ChromiumOptions.java b/java/src/org/openqa/selenium/chromium/ChromiumOptions.java index 2af0a72c93bf8..6f93930787217 100644 --- a/java/src/org/openqa/selenium/chromium/ChromiumOptions.java +++ b/java/src/org/openqa/selenium/chromium/ChromiumOptions.java @@ -31,7 +31,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.Set; import java.util.TreeMap; import java.util.stream.Stream; @@ -120,24 +119,12 @@ public T addArguments(String... arguments) { * "allow-outdated-plugins"); * * - *

Each argument may contain an option "--" prefix: "--foo" or "foo". Arguments with an + *

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 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 newArg = - arguments.stream().filter(arg -> arg.contains(remoteAllowOrigins)).findFirst(); - Optional existingArg = - args.stream().filter(arg -> arg.contains(remoteAllowOrigins)).findFirst(); - if (newArg.isPresent() && existingArg.isPresent()) { - args.remove(existingArg.get()); - } args.addAll(arguments); return (T) this; }