Skip to content
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

node: Add support for installing unpacked addons at runtime in Firefox webdriver #10216

Merged
merged 2 commits into from
Jan 10, 2022

Conversation

nickgaya
Copy link
Contributor

@nickgaya nickgaya commented Jan 4, 2022

Description

Add support for installing an extension from a directory in the Node.js Firefox WebDriver client.

The implementation checks if the addon path provided is a directory and, if so, creates a zip archive of the directory contents to send to geckodriver.

Motivation and Context

This implements #8357 for node. The same approach can be used for other language bindings.

The approach of creating an ad-hoc zip archive for a local directory was suggested here: #9494 (comment)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2022

Codecov Report

Merging #10216 (19af9f3) into trunk (816ad6e) will decrease coverage by 0.26%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk   #10216      +/-   ##
==========================================
- Coverage   45.19%   44.92%   -0.27%     
==========================================
  Files          85       85              
  Lines        5572     5473      -99     
  Branches      269      269              
==========================================
- Hits         2518     2459      -59     
+ Misses       2785     2745      -40     
  Partials      269      269              
Impacted Files Coverage Δ
py/selenium/webdriver/remote/remote_connection.py 29.96% <0.00%> (-4.18%) ⬇️
py/selenium/webdriver/remote/command.py 100.00% <0.00%> (ø)
py/selenium/webdriver/remote/shadowroot.py 58.82% <0.00%> (+31.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 816ad6e...19af9f3. Read the comment docs.

@sonarcloud
Copy link

sonarcloud bot commented Jan 4, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@nickgaya nickgaya marked this pull request as ready for review January 4, 2022 06:13
@titusfortner
Copy link
Member

Wow, this is great! Thank you for the extra effort you put in to make the extensions available in common. Now I actually have to re-implement things in the other languages to follow this approach.

Copy link
Member

@harsha509 harsha509 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @nickgaya.

@l0b0
Copy link

l0b0 commented Jan 23, 2022

If this does what I think it does (being able to install unsigned extensions locally without having to build my own Selenium for Firefox Devedition) that would be fantastic! Is that right? If so, is there some documentation on how to use it, or should it just work in the same way as in Devedition?

@titusfortner
Copy link
Member

It should already work if you zip the directory yourself. This PR lets you just pass in the path and Selenium will zip and send for you.

You can see examples here — https://github.com/SeleniumHQ/selenium/blob/trunk/javascript/node/selenium-webdriver/test/firefox_test.js#L222

elgatov pushed a commit to elgatov/selenium that referenced this pull request Jun 27, 2022
…x webdriver (SeleniumHQ#10216)

* node: Add support for installing unpacked addons at runtime in Firefox webdriver

* Move example webextension files to //common/extensions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants