Open Bug 1316741 Opened 8 years ago Updated 1 year ago

Implement chrome.debugger to let extensions use remote debugging protocol

Categories

(WebExtensions :: Developer Tools, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: Harald, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: triaged)

https://developer.chrome.com/extensions/debugger My use case is an addon that continuously collects profiles for page load for analysis. Another use case is Lighthouse, which uses the remote debugging protocol to control the browser and collect profiling information: https://github.com/GoogleChrome/lighthouse/tree/master/lighthouse-extension
Jim might have some insights into how this can work and if it makes sense to provide, effectively providing better compatibility for web extensions.
Flags: needinfo?(jimb)
Component: WebExtensions: Compatibility → WebExtensions: Developer Tools
reopening bug 1241448 - but Luca looking at now due to use case and progress. one expose are protocol (dev tools related) and two add an adapter. different priorities on two bugs. will set priority next week based on luca's input.
Flags: needinfo?(lgreco)
That API seems to provide a way to send Chrome protocol packets to the debuggee. We don't yet have a Chrome protocol server, so this isn't feasible to implement. However, we do plan to transition the JavaScript debugger to the Chrome protocol (and share the server code between Servo and Gecko). Once that is done, this might make sense to pursue, since it will simply be offering access to something we've already implemented. The transition to the Chrome protocol is expected to take place in 2017. Our plans to provide a JS debugger for Servo depend on it.
Flags: needinfo?(jimb)
We recently discussed about the chrome.debugger API again and I was going to open a new bugzilla issue related to implementing the debugger API to provide our debugging protocol, which do not cover the Chrome compatibility side of this API, but it can be useful to help the transition of existent Firefox add-ons into WebExtensions (e.g. all the Firebug addons are already using our RDP protocol directly) Given the plans for implementing the Chrome debugging protocol, I think that we can: - re-open Bug 1241448 (which was explicitly related to the Chrome compatibility part) and add to it the "tracking bug" of the "Chrome Debugging protocol implementation" as a dependency - use this bugzilla issue to start discussing and implementing an initial version of the debugger API which will provide our current RDP protocol (and the we will add support for the Chrome debugging procotol as part of Bug 1241448, once its dependencies have been landed).
Flags: needinfo?(lgreco)
Thanks Jim, is there already a tracking bugzilla issue for it? (related to the Chrome debugging protocol server)
Flags: needinfo?(jimb)
I just filed bug 1323098 to serve as a tracking bug for all debugger-related Chrome protocol support work.
Flags: needinfo?(jimb)
Priority: -- → P3
Whiteboard: triaged
If we add support for this, I request that we make it usable with both the Chrome and Firefox debugging protocols by passing an optional 'protocol' parameter of type 'String' to the 'target' parameter in the 'attach' function. The 'protocol' parameter would have the following values as valid (in Firefox): - 'chrome' (default) - Specifies that this extension wants to receive debugging events using the Chrome Debugging Protocol - 'firefox' - Specifies that this extension wants to receive debugging events using the Firefox Debugging Protocol One reason for this is to make it easier for legacy Firefox debugging add-ons using the Firefox Debugging Protocol would be able to keep using the Firefox Debugging Protocol during the Embedded WebExtension stage of porting without needing to translate to/from the Chrome Debugging Protocol when passing information between the legacy portion and the Embedded WebExtension portion. Another reason is so that there is some competition in the debugging protocol area, thus preventing stagnation. Other browser vendors will be allowed to add their own protocols to this (but these two, or at least 'chrome' should be standard).
Hi, do we have a timeline for this issue?
No timeline for making this happen yet. We're interested but not yet committed.
Many folks in the industry would like to see this for cross-browser integration testing efforts. These folks are currently using puppeteer, which only tests Chrome today. With some work we could leverage the same code to test across multiple browser environments without having to resort to using a heavy-weight solution like Selenium.
Depends on: 1323098
Product: Toolkit → WebExtensions

Any news in this area? Thread created 3 years ago, and I see that community is trying to handle this missing API: https://github.com/puppeteer/juggler

Depends on: puppeteer
No longer depends on: 1323098
Type: defect → task

Any news on this Bug?
My use case is an addon that automate the page as testing tool. We need the debugger to listen to events like Page.javascriptDialogOpening, Page.javascriptDialogClosed and etc.

DevTools has currently no plans to enable this API; while https://bugzilla.mozilla.org/show_bug.cgi?id=puppeteer might get us partway there. I would recommend finding other ways to control dialogs meanwhile.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.