Implement browser.debugger API to let extensions use WebDriver BiDi
Categories
(WebExtensions :: Developer Tools, enhancement)
Tracking
(Not tracked)
People
(Reporter: gregp, Unassigned)
References
Details
(Whiteboard: [design-decision-needed][wecg])
This would be incompatible with the CDP-backed chrome.debugger api, so it should probably be in the browser
namespace only.
It would need some limitations, e.g. extensions probably shouldn't be able to use script.evaluate.
We could also have more fine-grained permissions. Maybe putting each module behind its own permission and having specific permissions for receiving events and sending commands. Something like debugger.network
/debugger.network.commands
Comment 1•1 year ago
|
||
The capabilities of browser
and chrome
namespaces should be equivalent.
While bug 1316741 already tracks the debugger
API, I'm not closing this bug yet because the unique part of it is the request to support WebDriver BiDi, which is the long-term cross-browser protocol for automation.
Reporter | ||
Comment 2•1 year ago
•
|
||
The capabilities of
browser
andchrome
namespaces should be equivalent.
There is precedent for incompatible APIs only being available in the browser
namespace
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities#proxy_api
Edit: Actually this documentation might be wrong. I just tested and the proxy
api is available in the chrome
namespace ?
Comment 3•1 year ago
|
||
(In reply to Gregory Pappas [:gregp] from comment #2)
There is precedent for incompatible APIs only being available in the
browser
namespace
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities#proxy_apiEdit: Actually this documentation might be wrong. I just tested and the
proxy
api is available in thechrome
namespace ?
That documentation is wrong. I filed https://github.com/mdn/content/issues/27512 to fix it.
Comment 4•1 year ago
|
||
Hi Gregory, what do you have in mind with the WebDriver BiDi support? It's not clear to me yet. Note that this protocol is not enabled by default, but needs a specific command line argument to get it working. And we do not want to have it running in day to day profiles but just for automation and testing. Maybe you can shed more details?
Comment 5•1 year ago
|
||
My interpretation is as follows:
- Someone wanted the ability to retrieve console log messages in an extension, at bug 1433724.
- I mentioned alternatives and that Chrome already supports such functionality through the
chrome.debugger
extension API that connects through CDP, at https://bugzilla.mozilla.org/show_bug.cgi?id=1433724#c5 - You commented that WebDriver BiDi should be used instead of CDP - https://bugzilla.mozilla.org/show_bug.cgi?id=1433724#c6
- Now we're here - a feature request to expose the WebDriver BiDi protocol through the
browser.debugger
protocol (note:browser
andchrome
are aliases of each other, the namespace of extension APIs).
Updated•1 year ago
|
Reporter | ||
Comment 6•1 year ago
|
||
(In reply to Henrik Skupin [:whimboo][⌚️UTC+2] from comment #4)
Hi Gregory, what do you have in mind with the WebDriver BiDi support? It's not clear to me yet.
I'm not sure of what you're asking, sorry. Are you asking which WebDriver Bidi functionality would be exposed?
Comment 7•1 year ago
|
||
Oh I would like to know an end-user scenario for what such an API would be helpful. We already imagined that webext
can benefit from BiDi but here I'm unclear also security wise.
Comment 8•1 year ago
|
||
Gregory, can you please provide a use case, what would this enable an extension to do that's not already possible using the existing devtools APIs?
Reporter | ||
Comment 9•1 year ago
|
||
What would this enable an extension to do that's not already possible using the existing devtools APIs?
- Access console logs without a content script (bug 1433724)
Note that the WebDriver BiDi implementation in Firefox is still new, so a lot of functionality that is not possible with the existing devtools APIs will eventually become available in the future as more of the specification gets implemented.
Description
•