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

Use the README.md example but always got "No inspectable targets" #136

Closed
hinablue opened this issue May 25, 2017 · 5 comments
Closed

Use the README.md example but always got "No inspectable targets" #136

hinablue opened this issue May 25, 2017 · 5 comments
Labels

Comments

@hinablue
Copy link

I modified the chrome.js and print the targets, it show me this,

{ description: '',
  devtoolsFrontendUrl: '/devtools/inspector.html?ws=localhost:9222/devtools/page/781998de-c9e7-4ef1-b5c4-f747092f92da',
  id: '781998de-c9e7-4ef1-b5c4-f747092f92da',
  title: '127.0.0.1',
  type: 'page',
  url: 'http://127.0.0.1/',
  webSocketDebuggerUrl: 'ws://localhost:9222/devtools/page/781998de-c9e7-4ef1-b5c4-f747092f92da' }
{ description: '',
  id: '781998de-c9e7-4ef1-b5c4-f747092f92da',
  title: 'https://hinablue.me/interns/ji-shu-xing-xiaoshang-ye-kai-fa-zhu-li',
  type: 'page',
  url: 'https://hinablue.me/interns/ji-shu-xing-xiaoshang-ye-kai-fa-zhu-li' }

The second object is my URL but webSocketDebuggerUrl does not exists.

How can I fix it?

My env,
Ubuntu 16.04 LTS
Google Chrome 58.0.3029.81

And Google Chrome run with headless,
chrome --headless --disable-gpu --window-size=1366,768 --remote-debugging-port=9222 --user-data-dir=/mnt/tmp http://127.0.0.1

@cyrus-and
Copy link
Owner

I modified the chrome.js and print the targets

You can also use chrome-remote-interface list for that.

How can I fix it?

Are you sure there isn't another chrome-remote-interface session (or any other CDP client) attached to that tab? If a tab is being inspected then the webSocketDebuggerUrl field is omitted as you cannot have simultaneous protocol clients.

@cyrus-and
Copy link
Owner

Did you go any further with this?

@popsail
Copy link

popsail commented Jun 19, 2017

Happened to me as well.
It works when I connect, but if I close that connection and re-connect again later - that's the error i'm getting.

Maybe client.close() doesn't do what it's supposed to ?

@cyrus-and
Copy link
Owner

@popsail from a previous comment: are you sure there isn't another chrome-remote-interface session (or any other CDP client) attached to that tab? If a tab is being inspected then the webSocketDebuggerUrl field is omitted as you cannot have simultaneous protocol clients.

Show me the output of chrome-remote-interface list when that error happens.

@zsxsoft
Copy link

zsxsoft commented Jul 17, 2017

@cyrus-and
I also got this error, and I edited lib/chrome.js and added log like this:
image
Output like this:
image

Then I found:
image

So I think it will be caused if CDP inspects the same target more than once. Not a bug, just a user's wrong.

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

No branches or pull requests

4 participants