Skip to content
This repository was archived by the owner on Dec 6, 2022. It is now read-only.

Conversation

@yavanosta
Copy link

There is no any reasons to prohibit debug of anything but 'page'. For example i'm using this extension for debugging chrome itself, and some internal pages have type equals to 'other'.

Another case is debugging shared or service workers.

Suggestion is to add new configuration parameter for type selection, witch is defaults to ['page'] to save previous behavior, but can be changed to allow debugging other types of content.

@yavanosta
Copy link
Author

Should I provide some additional info for this PR, make some changes or do something else?

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Sorry for the slow response. I was a little conflicted about taking it because I haven't tested it against any target other than a normal Chrome page, and don't want to advertise too much about supporting scenarios that I am not testing. I might add an extra note to that effect in the readme. But I think it's better to have this than for it to be impossible to attach to anything else.

Please just add the new attribute to the package.json (and package.nls.json) following the pattern of the other attributes, then I'll merge it.

@yavanosta
Copy link
Author

It is ok to debug at least pages with other target types.

JFYI: here is code that determine target type in chromium:
https://chromium.googlesource.com/chromium/src/+/master/chrome/browser/devtools/chrome_devtools_manager_delegate.cc#133

@roblourens roblourens merged commit 65d849b into microsoft:master Mar 28, 2018
extensionName: EXTENSION_NAME,
logFilePath: path.resolve(os.tmpdir(), 'vscode-chrome-debug.txt'),
targetFilter,
targetFilter: targetFilterProvider(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work. I guess I didn't review it closely enough. Did you test this PR? This also needs changes in the -core library to allow a targetFilter to be determined by the launch config. I'm reverting this PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I'm really sorry, yes of course i've tested it. Maybe I didn't check all cases. I'll try to rework it and make another PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please help me about changes in core library?

As far as I have seen it need delegate as a filter and does not need any information about what this delegate does. So I thought that generating delegate according to launch config will be enough.

So according to your comment I missed something, could you please point me what?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commented line just generates the default filter for page, since targetFilterProvider doesn't take an argument.

I think that somewhere in -core it will have to read the list of targetFilterTypes and create the filter. That will mean that targetFilter won't be passed to the session here, and ChromeConnection won't take the targetFilter in its constructor. Instead it will be an argument passed to ChromeConnection.attach https://github.com/Microsoft/vscode-chrome-debug-core/blob/master/src/chrome/chromeConnection.ts#L120

Copy link
Author

@yavanosta yavanosta Mar 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh shame on me, i've completely misunderstood purpose of chromeDebug.ts file and yes, now I see that I have not test it properly. So i'm sorry for this.

Ok then, we must learn from our mistakes. As far as i see, correct way should look like this:

  1. Make PR to -core lib which mark targetFilter in IChromeDebugAdapterOpts as obsolete or remove it
  2. In same PR add support for targetFilterTypes in ICommonRequestArgs
  3. Merge this PR into -core library if it is possible.
  4. Come back here, remove targetFilter usage and migrate to targetFilterTypes
  5. Create Issue in rest of debuggers based on -core lib.

Does it sounds like a plan?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that sounds great

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants