-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[Javascript] Add support for installing addon by remote path in Firefox #9494
[Javascript] Add support for installing addon by remote path in Firefox #9494
Conversation
@nickgaya Sorry for taking so long to get to this PR. What does You mention that it uses the path on the server, how does it get there? |
@AutomatedTester When using Selenium Grid, the WebDriver library is invoked on one machine (the "local" environment) and sends commands to a browser which may be running on a different machine (the "remote" environment). The
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this work, but I'm implementing the other languages per #8357 the way the JS bindings are now. There is not a compelling reason not to use toString('base64')
on everything and always using addon
parameter. The Mozilla commit indicated this was a more of a replacement than an alternative, and having an extra parameter to toggle between these is an unnecessary/confusing complication/maintenance burden, imo.
Hi @titusfortner, I'm not sure exactly what you mean.
#8357 describes a use-case which is not currently supported by the JS bindings, as far as I know.
This PR allows the user to install "unpacked" addon directories which cannot be converted to a base64-encoded string. I believe this is a fairly common use-case when developing/testing an addon. See this project for an example. In this example, I used the low-level command API as a workaround, but it would be preferable to be able to do this with the |
Ah, but it can be, I've tested it. You can zip the directory, encode it and send it along with |
@titusfortner You are correct that you can install a packed extension .zip or .xpi file with the current API. This PR addresses feature request #8357, "As a Firefox extension developer, I would like to install a temporary extension from a folder". Since it's already supported by geckodriver I don't see a reason for Selenium not to support this. Ultimately I think it's best if we can make both forms of the |
Look, I see exactly what you are doing and why and it does indeed allow you to set a profile directory as temporary and use it when the directory exists on the same machine as the driver. You've even created a new extension, which is great, and I'd like to put it in our I'm not a JS dev, so I can't speak to the code, but I've been working with this specific feature in all the other languages, and this solution has a few things that aren't ideal.
So maybe the method can check if the path provided is a directory and zip it for the user. It will work both locally and remotely without the need for a toggle or a File Detector. |
Okay, if there's a plan to address #8357 in a different way that's standardized across languages, then this PR is probably not needed. The unpacked extension in this PR is just the unzipped version of the existing webextension.xpi in /javascript/node/selenium-webdriver/lib/test/data/firefox; feel free to use that when writing tests for other language bindings. |
Description
Add a
remotePath
parameter to the firefoxDriver.installAddon()
method to allow specifying a path to the addon on the WebDriver server.Motivation and Context
Geckodriver allows two ways of specifying an addon to install at runtime:
addon
parameterpath
parameterCurrently the Javascript code reads the specified path to a string and sends it using the
addon
parameter. This requires the addon to be in a "packed" .xpi or .zip file format.This change adds the capability to send the path to the remote server instead of the addon data. In this case, the path may be either a .xpi/.zip file or an unpacked directory.
See #8357
Types of changes
Checklist