Skip to content

[🚀 Feature]: Support installation and uninstallation of web extensions via WebDriver BiDi #15585

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

Open
whimboo opened this issue Apr 7, 2025 · 13 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon! B-devtools Includes everything BiDi or Chrome DevTools related I-enhancement Something could be better

Comments

@whimboo
Copy link
Contributor

whimboo commented Apr 7, 2025

Description

WebDriver BiDi now has commands for installing and uninstalling web extensions which Chrome and Firefox have already implemented. As such it would be good to get those APIs as well added to Selenium.

https://w3c.github.io/webdriver-bidi/#command-webExtension-install
https://w3c.github.io/webdriver-bidi/#command-webExtension-uninstall

CC @pujagani.

Have you considered any alternatives or workarounds?

No response

@whimboo whimboo added A-needs-triaging A Selenium member will evaluate this soon! I-enhancement Something could be better labels Apr 7, 2025
@selenium-ci
Copy link
Member

@whimboo, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

@github-actions github-actions bot added the B-devtools Includes everything BiDi or Chrome DevTools related label Apr 7, 2025
@whimboo
Copy link
Contributor Author

whimboo commented Apr 7, 2025

Please note that in Firefox 137 we install the extension permanently which means that it's not allowed to install an unsigned or unpacked extension. This will be fixed in version 138.

@nvborisenko
Copy link
Member

"One line code" solution for .NET/C#. The primary question would be hoe to test whether an extension is installed successfully. I guess if the command executed without errors, we can treat it as success.

@whimboo
Copy link
Contributor Author

whimboo commented Apr 11, 2025

Yes, that is correct.

@Delta456
Copy link
Member

We can also assert the id of the extension with the extension id provided.

@Delta456
Copy link
Member

@whimboo I have implemented installation and uninstallation of web extensions in Java binding. I need to wait for stable 138 Firefox version before I can PR.

@whimboo
Copy link
Contributor Author

whimboo commented Apr 15, 2025

@Delta456 if you don't have a signed XPI to test that I would recommend, yes. Before that unsigned XPIs and unpacked web extensions will not work.

@Delta456
Copy link
Member

Yes, I am waiting for the version. Please ping me here when its out 😃

@oliverdunk
Copy link

@Delta456 Excited to see your PR! We're removing the --load-extension flag in some situations in Chrome, and as a result there is community interest in seeing an alternative fairly soon.

Of course, since we're making the change we're open to spending some time on the necessary changes across libraries.

Do you plan to continue work on your PR? Is there anything I can do to help?

Of course, we should make sure the Selenium team are also supportive of this. I'm not sure if I've seen anything confirming that yet.

@Delta456
Copy link
Member

Hi @oliverdunk, the implementation is done. I am awaiting someone to review my PR and hoping the browser versions are now updated. Neither Chrome stable or nightly does not support Web Extension BIDI, as shown on WPT

Image

@oliverdunk
Copy link

Neither Chrome stable or nightly does not support Web Extension BIDI, as shown on WPT

We do support it, but only from a path. I believe this is what the middle line is showing in the WPT results.

I am awaiting someone to review my PR

Oh, great. Have you considered unmarking it as a draft? I expect that might encourage the maintainers to take a look.

@Delta456
Copy link
Member

We do support it, but only from a path. I believe this is what the middle line is showing in the WPT results.

Yes, Firefox is working completely, so I have made a PR based on that. We can add Chrome support as per the version releases.

Oh, great. Have you considered unmarking it as a draft? I expect that might encourage the maintainers to take a look.

The CI has been failing because the version bump didn't happen, so I kept it a draft.

@navin772
Copy link
Member

The support for webExtensions in python bindings have landed via #15749 and is available in release 4.33.

Firefox and chromium based browsers can utilize this bidi module, but chrome/edge requires 2 additional flags in order to work:

  1. --remote-debugging-pipe
  2. --enable-unsafe-extension-debugging

#15794 aims to add a chrome/edge option - enable_webextensions that simplifies this. Until this is merged, the above flags need to be passed for extensions to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-needs-triaging A Selenium member will evaluate this soon! B-devtools Includes everything BiDi or Chrome DevTools related I-enhancement Something could be better
Projects
None yet
Development

No branches or pull requests

6 participants