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

Multi-client remote debugging support #14540

Closed
4eveRS opened this issue Sep 11, 2018 · 6 comments
Closed

Multi-client remote debugging support #14540

4eveRS opened this issue Sep 11, 2018 · 6 comments
Assignees
Labels
3-0-x bug 🪲 platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@4eveRS
Copy link

4eveRS commented Sep 11, 2018

Describe the solution you'd like
Since version 63, Chrome supports multi-client remote debugging, which means it can handle multiple debugger clients (such as webContents.debugger and devTools) at the same time.

In Electron current version, v3.0 Beta, this functionality is not working properly. Once the user set the debbuger in a webContent, if the same webContent request to open the devTools, the previous debugger attached to the webContent is detached and all configurations are lost.

I think many Electron users will find this functionality very useful, since it can give the full support of chrome devTool in app background while the app users can access the devTools of the same webContent.

My application for example, which is a browser, really needs that functionality in order to analyze the page and it's content, while it can't / shouldn't block the user to access the devTools of that same page.

Additional context

https://developers.google.com/web/updates/2017/10/devtools-release-notes#multi-client
https://crbug.com/129539

@MarshallOfSound
Copy link
Member

We actually have a test to ensure this works, see

assert.equal(secondSessionOpened, true)

Can you fill out the Bug Report issue template in a comment below, in particular a minimal repro and version information would be very useful

@4eveRS
Copy link
Author

4eveRS commented Sep 11, 2018

Electron version: v3.0.0-beta.5
Operating System: macOS Sierra 10.12.6

Expected Behavior
Multi-client remote debugging should be supported by Electron.

Actual Behavior
Multi-client remote debugging is not actually supported.

Example of actual behavior
Create a webview and attach a debugger to its webContents.
Send commands to test if its working.
Enable webview devTools.
webContents debugger is detached and lose all commands sent before the devTools was opened.

To Reproduce

https://gist.github.com/4eveRS/b80a836c313864d394191e7347efa580

$ git clone git@gist.github.com:b80a836c313864d394191e7347efa580.git
$ npm install
$ npm start || electron .

@4eveRS
Copy link
Author

4eveRS commented Sep 11, 2018

One thing that I just noticed is that, if we use commands that use debugger/devTools interface, for example, setting a viewport in a webview through webContents.enableDeviceEmulation(), if later we set a debugger to that same webContents, that device emulation is disabled.

So there's a issue when running debuggers, devTools and commands in webContents that utilize the devTools protocol.

@deepak1556
Copy link
Member

@4eveRS Thanks for the test case, i have fixed the multi client problem while doing a cleanup in #14522, will backport the specific fix to 3-0-x branch soon.

@deepak1556 deepak1556 added the status/confirmed A maintainer reproduced the bug or agreed with the feature label Sep 11, 2018
@deepak1556 deepak1556 self-assigned this Sep 11, 2018
@deepak1556
Copy link
Member

Fixed in #14566

@praneetrohida
Copy link

praneetrohida commented May 18, 2020

I'm having the exact same issue in Electron 8.x

To elaborate, if I have the devtools open for a webview and if I call webContents.debugger.attach() for that webview, the devtools lose connection with the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3-0-x bug 🪲 platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
None yet
Development

No branches or pull requests

5 participants