Sharing Debugger Connection with DevTools for My Extension

99 views
Skip to first unread message

Oldrich Kepka

unread,
Oct 17, 2023, 12:36:03 PM10/17/23
to Chromium Extensions

Hello everyone,

I am currently developing a DevTools extension for Chrome. For my extension to function correctly, it requires a debugger connection to the page. However, I've observed that this debugger connection is already established by DevTools when it's opened.

Is there a way for my extension to share the existing debugger connection with the rest of the DevTools? Alternatively, can my extension borrow the debugger connection from DevTools temporarily or somehow interact with it?

I appreciate any guidance or best practices related to this.

Best regards,

Oldrich Kepka

wOxxOm

unread,
Oct 18, 2023, 5:39:22 AM10/18/23
to Chromium Extensions, Oldrich Kepka
Not possible. Devtools session is allowed to use all of the CDP without any limits, but extensions can't do it.

Simeon Vincent

unread,
Oct 18, 2023, 10:54:28 AM10/18/23
to wOxxOm, Chromium Extensions, Oldrich Kepka
Why do you want to reuse the CDP connection? According to the Chrome DevTools Protocol site, a single website can have multiple CDP connections.

Does the protocol support multiple simultaneous clients? 

Chrome 63 introduced support for multiple clients. See this article for details.

Simeon - @dotproto


--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/0349f386-8a7a-474a-8129-92874c840427n%40chromium.org.

Oldrich Kepka

unread,
Oct 19, 2023, 3:41:21 AM10/19/23
to Chromium Extensions, Simeon Vincent, Chromium Extensions, Oldrich Kepka, wOxxOm
Let me check it again, I was trying it like 2 month ago. I think when I tried to connect with `debugger.attach` exception has been thrown, may be I am mistaken.

thanks for your help,
Olda

wOxxOm

unread,
Oct 19, 2023, 4:16:00 AM10/19/23
to Chromium Extensions, Oldrich Kepka, Simeon Vincent, Chromium Extensions, wOxxOm
There are bugs and architectual limitations that may prevent connection e.g. when the page contains an iframe from another extension.
Reply all
Reply to author
Forward
0 new messages