public class FirefoxProfile extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PORT_PREFERENCE |
Modifier | Constructor and Description |
---|---|
|
FirefoxProfile() |
|
FirefoxProfile(File profileDir)
Constructs a firefox profile from an existing profile directory.
|
protected |
FirefoxProfile(Reader defaultsReader,
File profileDir) |
Modifier and Type | Method and Description |
---|---|
void |
addExtension(Class<?> loadResourcesUsing,
String loadFrom) |
void |
addExtension(File extensionToInstall)
Attempt to add an extension to install into this instance.
|
void |
addExtension(String key,
Extension extension) |
boolean |
areNativeEventsEnabled() |
void |
clean(File profileDir) |
protected void |
cleanTemporaryModel() |
boolean |
containsWebDriverExtension() |
protected void |
copyModel(File sourceDir,
File profileDir) |
void |
deleteExtensionsCacheIfItExists(File profileDir) |
protected void |
deleteLockFiles(File profileDir) |
static FirefoxProfile |
fromJson(String json) |
protected org.openqa.selenium.firefox.Preferences |
getAdditionalPreferences() |
protected void |
installExtensions(File parentDir) |
File |
layoutOnDisk()
Call this to cause the current profile to be written to disk.
|
protected 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) |
void |
setPreference(String key,
boolean value)
Set a preference for this particular profile.
|
void |
setPreference(String key,
int value)
Set a preference for this particular profile.
|
void |
setPreference(String key,
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.
|
String |
toJson() |
void |
updateUserPrefs(File userPrefs) |
public static final String PORT_PREFERENCE
public FirefoxProfile()
public FirefoxProfile(File profileDir)
Users who need this functionality should consider using a named profile.
profileDir
- The profile directory to use as a model.@Beta protected Reader onlyOverrideThisIfYouKnowWhatYouAreDoing()
public boolean containsWebDriverExtension()
public void addExtension(Class<?> loadResourcesUsing, String loadFrom) throws IOException
IOException
public void addExtension(File extensionToInstall) throws IOException
extensionToInstall
- IOException
public void setPreference(String key, String value)
key
- The keyvalue
- The new value.public void setPreference(String key, boolean value)
key
- The keyvalue
- The new value.public void setPreference(String key, int value)
key
- The keyvalue
- The new value.protected org.openqa.selenium.firefox.Preferences getAdditionalPreferences()
public void updateUserPrefs(File userPrefs)
protected void deleteLockFiles(File profileDir)
public void deleteExtensionsCacheIfItExists(File profileDir)
public boolean areNativeEventsEnabled()
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)
untrustedIssuer
- whether to assume untrusted issuer or not.public void clean(File profileDir)
public String toJson() throws IOException
IOException
public static FirefoxProfile fromJson(String json) throws IOException
IOException
protected void cleanTemporaryModel()
public File layoutOnDisk()
FirefoxDriver
.protected void copyModel(File sourceDir, File profileDir) throws IOException
IOException
protected void installExtensions(File parentDir) throws IOException
IOException
Copyright © 2014. All rights reserved.