Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Chrome 111+ #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

fluidsonic
Copy link

@fluidsonic fluidsonic commented Mar 8, 2023

Chrome 111 was just released which breaks this library.
HTTP PUT must now be used instead of GET for json/new. Should work with older Chrome versions too.

Note that the origin for DevTools Websocket connections must now be specified explicitly, e.g. using --remote-allow-origins=* (see https://groups.google.com/g/chromedriver-users/c/xL5-13_qGaA).

ChromeArguments.defaults(true)
    //
    .additionalArguments("remote-allow-origins", "*")

Fixes

com.github.kklisura.cdt.services.exceptions.ChromeServiceException: Server responded with non-200 code: 405 - Method Not Allowed. Using unsafe HTTP verb GET to invoke /json/new. This action supports only PUT verb.

@fluidsonic
Copy link
Author

In the meantime, I've created a fork and released it on Maven Central under io.fluidsonic.mirror:cdt-java-client:4.0.0-fluidsonic-1. This PR is the only change.

@elfoxus
Copy link

elfoxus commented Mar 9, 2023

Thank you for you input. I've just added new issue regarding this case and also wanted to do something with that issue. :)

@imspzero
Copy link

Thanks a lot, @fluidsonic.
I am facing the same issue recently. I have verified that your branch and tips of the specific origin all are working fine for me.

@karlvr
Copy link

karlvr commented Mar 15, 2023

Thanks @fluidsonic, much appreciated. You added to the readme about the launch arguments... I've had to add the option to ChromeArguments to get this working. I also made it default... perhaps the default could be the local IP address?

For anyone needing to fix the 101 continue 403 forbidden issue referenced in #87:

karlvr@72d7264

@nablex
Copy link

nablex commented Mar 15, 2023

@fluidsonic Thank you for the fork and the origin workaround. It helped us enormously!

@sporritt
Copy link

+1 on this. Thanks @fluidsonic for the patched library.

I checked the remote-allow-origins flag too and can confirm it must be set to '*', or I get a 'Failed connecting to tab web socket' error.

val args = ChromeArguments.defaults(true)
      .headless()
      .additionalArguments("no-sandbox", true)
      .additionalArguments("remote-allow-origins", "*")
      .build()

Given that remote-allow-origins is likely always required from Chrome 111+, would it make sense to also bake that in to the lib? It doesn't seem like the sort of thing that would break backwards compatibility.

@fluidsonic
Copy link
Author

Setting remote-allow-origins to * by default likely defeats the security purpose for which it was introduced. Explicitly setting it makes more sense for now as it highlights a potential security risk depending on the context.

It's mandatory to specify a port in the origin. But I have no idea how to figure out the port as the connection isn't set up at browser startup and there can probably even be multiple websocket connections at a time 🤔

@pmrelvas
Copy link

pmrelvas commented Jun 1, 2023

In the meantime, I've created a fork and released it on Maven Central under io.fluidsonic.mirror:cdt-java-client:4.0.0-fluidsonic-1. This PR is the only change.

Thanks a lot @fluidsonic, you are a life savior! 🤗

Repository owner deleted a comment from technosoft-admin Mar 4, 2024
@JAndrassy
Copy link

JAndrassy commented Jul 25, 2024

@sinaa why not merge this PR? we have to use fluidsonics' build to have a working cdt client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants