I managed to solve it as follows FirefoxOptions options = new FirefoxOptions();
options.addPreference("browser.download.folderList", 2);
options.addPreference("browser.download.dir", paramDownload);
options.addPreference("browser.download.useDownloadDir", true);
options.addPreference("browser.helperApps.neverAsk.saveToDisk",
"application/pdf," + "text/plain," + "application/octet-stream," + "application/x-pdf,"
+ "application/vnd.pdf," + "application/vnd.openxmlformats-officedocument.spreadsheethtml,"
+ "text/csv," + "text/html," + "application/x-msexcel," + "application/excel,"
+ "application/x-excel," + "application/vnd.ms-excel");
options.addPreference("pdfjs.disabled", true);
if (headless) {
options.addArguments("--headless");
}
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.addExtension(new File("/home/henrique/Documentos/websigner@softplan.com.br.xpi"));
options.setProfile(firefoxProfile);
System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, "/home/files/logsGeckodriver.txt");
WebDriver driver = new FirefoxDriver(options);
to get the .xpi from the extension, I installed the extension in a profile, and then took the .xpi inside the profile folderI tmb realized that in the manner cited in the question, in a way it was working, however it takes about unbelievable 20m to instantiate, the webDriver, it took so long to render the browser that he thought was not working and killed the application.in the way cited in the response, it takes about 1m to render only the first time when starting the server, then it works normally