-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Support for Firefox WebExtensions #1181
Comments
We haven't been able been able to get the webdriver.xpi extension (i.e. the FirefoxDriver) signed by Mozilla, and I don't believe we will. This particular feature may have to way for Marionette (Mozilla's WebDriver implementation). |
Below is a workaround I use written in Java. You just need to copy the entire .xpi to the "[PATH_TO_FIREFOX_PROFILE]/extensions" directory. Firefox will unpack and install automatically when launched via FirefoxDriver. import org.openqa.selenium.firefox.internal.Extension;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
public class FirefoxWebExtension implements Extension {
private final File toInstall;
public FirefoxWebExtension(File toInstall) {
this.toInstall = toInstall;
}
@Override
public void writeTo(File extensionsDir) throws IOException {
if (!extensionsDir.exists()) {
extensionsDir.mkdirs();
}
Files.copy(
toInstall.toPath(),
Paths.get(
extensionsDir.getAbsolutePath(),
toInstall.getName()
),
StandardCopyOption.REPLACE_EXISTING
);
}
} |
@cmolocznik I'm new to Selenium, so I'm not too familiar with the project structure. Where would your workaround be placed in order to be functional? |
See #3846 |
Fixed by 2f1df98 |
Mozilla introduced new WebExtensions API, which works already in Firefox Nightly. The old CPOWs extensions will be deprecated.
Trying to load an extension to Firefox Nightly, Seenium tries to find
install.rdf
, which doesn't exist anymore.Any plans to support the new extension format for firefox?
The text was updated successfully, but these errors were encountered: