}
private EmbeddedBrowser newFireFoxBrowser(ImmutableSortedSet<String> filterAttributes,
long crawlWaitReload, long crawlWaitEvent) {
if (configuration.getProxyConfiguration() != null) {
FirefoxProfile profile = new FirefoxProfile();
String lang = configuration.getBrowserConfig().getLangOrNull();
if (!Strings.isNullOrEmpty(lang)) {
profile.setPreference("intl.accept_languages", lang);
}
profile.setPreference("network.proxy.http", configuration
.getProxyConfiguration().getHostname());
profile.setPreference("network.proxy.http_port", configuration
.getProxyConfiguration().getPort());
profile.setPreference("network.proxy.type", configuration
.getProxyConfiguration().getType().toInt());
/* use proxy for everything, including localhost */
profile.setPreference("network.proxy.no_proxies_on", "");
return WebDriverBackedEmbeddedBrowser.withDriver(new FirefoxDriver(profile),
filterAttributes, crawlWaitReload, crawlWaitEvent);
}