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

introduce a remote allocator option: NoModifyURL #1184

Merged
merged 4 commits into from Oct 31, 2022

Commits on Oct 26, 2022

  1. dot not call forceIP for the ExecAllocator

    In headful mode, the remote debugging address will always be 127.0.0.1
    or ::1, the command line option --remote-debugging-address is ignored.
    See https://github.com/chromium/chromium/blob/106.0.5249.119/chrome/browser/devtools/remote_debugging_server.cc#L48-L58
    
    In headless mode, the default remote debugging address is "localhost".
    If --remote-debugging-address is specified, its value should be an IP
    literal. See https://github.com/chromium/chromium/blob/106.0.5249.119/headless/app/headless_shell.cc#L750-L758
    
    The ExecAllocator reads the remote debugging address from the stdout
    of the browser. In all the cases listed above, the host of the address
    can only be "localhost" or an IP. So forceIP is not needed.
    
    This is a preparing step for further refactoring.
    ZekeLu committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    7a4b1d7 View commit details
    Browse the repository at this point in the history
  2. move the call of detectURL from NewRemoteAllocator to (*RemoteAllocat…

    …or).Allocate
    
    Because detectURL could fail. But there is not way to report the failure
    in NewRemoteAllocator (except for panicking).
    
    This is a preparing step for further refactoring.
    ZekeLu committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    3bb41f4 View commit details
    Browse the repository at this point in the history
  3. refactor detectURL and rename it to modifyURL

    Changes:
    
    1. make it context aware.
    2. make it return an error if it fails to modify the URL.
    3. bypass resolution when the host is "localhost" or an IP address.
    4. improve comments.
    ZekeLu committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    a8ee7a7 View commit details
    Browse the repository at this point in the history
  4. introduce a remote allocator option: NoModifyURL

    The remote allocator tries to modify the websocket debugger url passed
    to it.
    
    This behavior breaks browserless (https://www.browserless.io/). The
    option NoModifyURL is introduced to address this issue.
    ZekeLu committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    19b37c1 View commit details
    Browse the repository at this point in the history