From c35856c7b527bf28ce1cd024ddf6ac22f86e57b5 Mon Sep 17 00:00:00 2001 From: cssxsh Date: Thu, 16 Mar 2023 17:56:15 +0800 Subject: [PATCH] fix: ChromiumOptions Arguments --- src/main/kotlin/xyz/cssxsh/selenium/SeleniumInit.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/xyz/cssxsh/selenium/SeleniumInit.kt b/src/main/kotlin/xyz/cssxsh/selenium/SeleniumInit.kt index 8f44a0c..6065c4d 100644 --- a/src/main/kotlin/xyz/cssxsh/selenium/SeleniumInit.kt +++ b/src/main/kotlin/xyz/cssxsh/selenium/SeleniumInit.kt @@ -587,7 +587,7 @@ internal fun RemoteWebDriverConfig.toConsumer(): DriverOptionsConsumer = { capab addArguments("--hide-scrollbars") if (headless) { if (System.getProperty(CHROME_DRIVER_VERSION, "109").toInt() >= 109) { - addArguments("--headless=new") + addArguments("--headless") } else { addArguments("--headless=chrome") } @@ -595,7 +595,7 @@ internal fun RemoteWebDriverConfig.toConsumer(): DriverOptionsConsumer = { capab if (proxy.isNotBlank()) { addArguments("--proxy-server=${proxy}") } - + addArguments("--remote-allow-origins=*") addArguments("--user-agent=${userAgent}") addArguments("--window-size=${width},${height}") addArguments(arguments)