public class FirefoxProfile
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALLOWED_HOSTS_PREFERENCE |
static java.lang.String |
PORT_PREFERENCE |
Modifier | Constructor and Description |
---|---|
|
FirefoxProfile() |
|
FirefoxProfile(java.io.File profileDir)
Constructs a firefox profile from an existing profile directory.
|
protected |
FirefoxProfile(java.io.Reader defaultsReader,
java.io.File profileDir) |
Modifier and Type | Method and Description |
---|---|
void |
addExtension(java.lang.Class<?> loadResourcesUsing,
java.lang.String loadFrom) |
void |
addExtension(java.io.File extensionToInstall)
Attempt to add an extension to install into this instance.
|
void |
addExtension(java.lang.String key,
Extension extension) |
boolean |
areNativeEventsEnabled()
Deprecated.
"Native" events are not supported in FirefoxDriver anymore
|
void |
clean(java.io.File profileDir) |
protected void |
cleanTemporaryModel() |
boolean |
containsWebDriverExtension() |
protected void |
copyModel(java.io.File sourceDir,
java.io.File profileDir) |
void |
deleteExtensionsCacheIfItExists(java.io.File profileDir) |
protected void |
deleteLockFiles(java.io.File profileDir) |
static FirefoxProfile |
fromJson(java.lang.String json) |
protected org.openqa.selenium.firefox.Preferences |
getAdditionalPreferences() |
boolean |
getBooleanPreference(java.lang.String key,
boolean defaultValue) |
int |
getIntegerPreference(java.lang.String key,
int defaultValue) |
java.lang.String |
getStringPreference(java.lang.String key,
java.lang.String defaultValue) |
protected void |
installExtensions(java.io.File parentDir) |
java.io.File |
layoutOnDisk()
Call this to cause the current profile to be written to disk.
|
protected java.io.Reader |
onlyOverrideThisIfYouKnowWhatYouAreDoing()
Internal method.
|
void |
setAcceptUntrustedCertificates(boolean acceptUntrustedSsl)
Sets whether Firefox should accept SSL certificates which have expired, signed by an unknown
authority or are generally untrusted.
|
void |
setAlwaysLoadNoFocusLib(boolean loadNoFocusLib)
Sets whether the no focus library should always be loaded on Linux.
|
void |
setAssumeUntrustedCertificateIssuer(boolean untrustedIssuer)
By default, when accepting untrusted SSL certificates, assume that these certificates will come
from an untrusted issuer or will be self signed.
|
void |
setEnableNativeEvents(boolean enableNativeEvents)
Deprecated.
"Native" events are not supported in FirefoxDriver anymore
|
void |
setPreference(java.lang.String key,
boolean value)
Set a preference for this particular profile.
|
void |
setPreference(java.lang.String key,
int value)
Set a preference for this particular profile.
|
void |
setPreference(java.lang.String key,
java.lang.String value)
Set a preference for this particular profile.
|
boolean |
shouldLoadNoFocusLib()
Returns whether the no focus library should be loaded for Firefox profiles launched on Linux,
even if native events are disabled.
|
java.lang.String |
toJson() |
void |
updateUserPrefs(java.io.File userPrefs) |
public static final java.lang.String PORT_PREFERENCE
public static final java.lang.String ALLOWED_HOSTS_PREFERENCE
public FirefoxProfile()
public FirefoxProfile(java.io.File profileDir)
Users who need this functionality should consider using a named profile.
profileDir
- The profile directory to use as a model.@Beta protected FirefoxProfile(java.io.Reader defaultsReader, java.io.File profileDir)
@Beta protected java.io.Reader onlyOverrideThisIfYouKnowWhatYouAreDoing()
public java.lang.String getStringPreference(java.lang.String key, java.lang.String defaultValue)
public int getIntegerPreference(java.lang.String key, int defaultValue)
public boolean getBooleanPreference(java.lang.String key, boolean defaultValue)
public boolean containsWebDriverExtension()
public void addExtension(java.lang.Class<?> loadResourcesUsing, java.lang.String loadFrom)
public void addExtension(java.io.File extensionToInstall)
extensionToInstall
- File pointing to the extensionpublic void addExtension(java.lang.String key, Extension extension)
public void setPreference(java.lang.String key, java.lang.String value)
key
- The keyvalue
- The new value.public void setPreference(java.lang.String key, boolean value)
key
- The keyvalue
- The new value.public void setPreference(java.lang.String key, int value)
key
- The keyvalue
- The new value.protected org.openqa.selenium.firefox.Preferences getAdditionalPreferences()
public void updateUserPrefs(java.io.File userPrefs)
protected void deleteLockFiles(java.io.File profileDir)
public void deleteExtensionsCacheIfItExists(java.io.File profileDir)
@Deprecated public boolean areNativeEventsEnabled()
@Deprecated public void setEnableNativeEvents(boolean enableNativeEvents)
public boolean shouldLoadNoFocusLib()
public void setAlwaysLoadNoFocusLib(boolean loadNoFocusLib)
loadNoFocusLib
- Whether to always load the no focus library.public void setAcceptUntrustedCertificates(boolean acceptUntrustedSsl)
acceptUntrustedSsl
- Whether untrusted SSL certificates should be accepted.public void setAssumeUntrustedCertificateIssuer(boolean untrustedIssuer)
By default, it is assumed that the certificates were not be issued from a trusted CA.
If you are receive an "untrusted site" prompt on Firefox when using a certificate that was issued by valid issuer, but has expired or is being served served for a different host (e.g. production certificate served in a testing environment) set this to false.
untrustedIssuer
- whether to assume untrusted issuer or not.public void clean(java.io.File profileDir)
public java.lang.String toJson() throws java.io.IOException
java.io.IOException
public static FirefoxProfile fromJson(java.lang.String json) throws java.io.IOException
java.io.IOException
protected void cleanTemporaryModel()
public java.io.File layoutOnDisk()
FirefoxDriver
.protected void copyModel(java.io.File sourceDir, java.io.File profileDir) throws java.io.IOException
java.io.IOException
protected void installExtensions(java.io.File parentDir) throws java.io.IOException
java.io.IOException