New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 704503 link

Starred by 3 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: May 2017
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Unable to connect to new target before listing targets

Project Member Reported by skyos...@chromium.org, Mar 23 2017

Issue description

Reported on headless-dev@:

"Target.createTarget works on the browser endpoint.
However, when I use the returned targetId to connect to the page (i.e. /devtools/page/$targetId)."

"I have encountered same issue, workarounded by calling target list before opening socket to newly created target."
 

Comment 1 by yijin...@gmail.com, Mar 24 2017

Target.getTargets does not work for headless. I have to http get /json/list before connect to the page.

This might help: in DevToolsHttpHandler::OnWebSocketRequest, it tries to find the target id in agent_host_map_, which is only updated in handling /json/list or /json/new.
Owner: sushkov@chromium.org
Ill have a look
@skyostil: why don't you reuse connection to speak with the target? I.e. not use Target.sendBlah?
Project Member

Comment 4 by bugdroid1@chromium.org, Apr 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/82f29400ec0c56897e7e464cf91af7a1ce86e145

commit 82f29400ec0c56897e7e464cf91af7a1ce86e145
Author: pfeldman <pfeldman@chromium.org>
Date: Mon Apr 24 20:58:02 2017

DevTools: retain DTAH in all the targets to match their life time.

BUG= 704503 
TBR= changes in cast/ reflect changes to the API

Review-Url: https://codereview.chromium.org/2833213002
Cr-Commit-Position: refs/heads/master@{#466759}

[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/chrome/browser/android/devtools_manager_delegate_android.cc
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/chrome/browser/android/devtools_manager_delegate_android.h
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/chrome/browser/android/tab_android.cc
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/chrome/browser/android/tab_android.h
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/chrome/browser/devtools/device/devtools_device_discovery.cc
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/chrome/browser/devtools/device/devtools_device_discovery.h
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/chromecast/browser/devtools/cast_devtools_manager_delegate.cc
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/chromecast/browser/devtools/cast_devtools_manager_delegate.h
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/chromecast/browser/devtools/cast_devtools_manager_delegate_unittest.cc
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/content/browser/devtools/devtools_agent_host_impl.cc
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/content/browser/devtools/devtools_http_handler.cc
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/content/browser/devtools/devtools_http_handler.h
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/content/public/browser/devtools_agent_host.h
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/content/public/browser/devtools_manager_delegate.cc
[modify] https://crrev.com/82f29400ec0c56897e7e464cf91af7a1ce86e145/content/public/browser/devtools_manager_delegate.h

#3: That's probably more of a question to the original reporter. Maybe we should update our instructions around this? Also, our C++ bindings currently don't work very nicely with this kind of forwarding.
Status: Verified (was: Available)
I've tested the fix by pfeldman and it seems to work. I'm going to close this bug as fixed.

Sign in to add a comment