web-ext icon indicating copy to clipboard operation
web-ext copied to clipboard

Port the usage of the RDP protocol over to WebDriver BiDi

Open whimboo opened this issue 10 months ago • 4 comments

With WebDriver BiDi being adopted by more and more test and automation frameworks due to its cross-browser compatibility it would be great to see the web-ext tool also making use of WebDriver BiDi. Firefox' own RDP protocol via DevTools is not standardized and may surface changes which require clients to update their code. WebDriver BiDi APIs are stable and backward compatible.

It would be good to know which specific APIs for RDP are used by web-ext that are required to be supported by WebDriver BiDi. We may not support all of these yet, so having a list would certainly help us to prioritize / schedule remaining work to unblock a change of the underlying protocol.

CC @zombie, @rpl and @Rob--W

whimboo avatar Feb 12 '25 16:02 whimboo

@whimboo here is a list of the Firefox RDP methods web-ext is using:

  • addons RDP actor listAddons: (https://github.com/mozilla/web-ext/blob/c8bb14245ffd943e83946b91ff998d4fd9a54db7/src/firefox/remote.js#L130)
  • addons RDP actor installTemporaryAddon (https://github.com/mozilla/web-ext/blob/c8bb14245ffd943e83946b91ff998d4fd9a54db7/src/firefox/remote.js#L115)
  • addon RDP actor reload (https://github.com/mozilla/web-ext/blob/c8bb14245ffd943e83946b91ff998d4fd9a54db7/src/firefox/remote.js#L174)

rpl avatar Feb 12 '25 17:02 rpl

Install and re-install are currently the only supported operations in webdriver-bidi, added in https://github.com/w3c/webdriver-bidi/pull/778 and rendered at https://w3c.github.io/webdriver-bidi/#module-webExtension

The ability to retrieve the list of extensions and to reload individual extensions (at least to refresh the updated extension sources, without losing web/extension data) are not part of the protocol yet.

Rob--W avatar Feb 13 '25 13:02 Rob--W

@rpl provided the following additional context:

Bidi meta bugs being worked on at the moment:

and a comment from Henrik related to reloading the extension

(/end of @rpl comment)

About reloading - I'll discuss with other browser vendors about the appetite for supporting extension reloading as a first class feature. I can imagine a potential implementation to re-use the webExtension.install method.

Rob--W avatar Feb 13 '25 13:02 Rob--W

@rpl provided the following additional context: and a comment from Henrik related to reloading the extension

* Only reloading might be a problem right now given that we do not yet allow evaluation of scripts in the parent process. But I'm going to start working on it soon via https://bugzilla.mozilla.org/show_bug.cgi?id=1944570

* [Bug 1944570 - Support executing “script.evaluate” and “script.callFunction” for browsing contexts in the parent process](https://bugzilla.mozilla.org/show_bug.cgi?id=1944570)

Actually those two bugs wont be needed when we are ok with having the webExtension.listAddons and webExtension.reloadAddon() (or similar naming) as part of the specification. I think it makes sense to add them. I'll do when I'm back from vacation so that we can discuss it in the next month W3C meeting.

Thanks for all the helpful information!

whimboo avatar Feb 13 '25 14:02 whimboo