Class FirefoxProfile
Provides the ability to edit the preferences associated with a Firefox profile.
public class FirefoxProfile
- Inheritance
-
FirefoxProfile
- Inherited Members
Constructors
FirefoxProfile()
Initializes a new instance of the FirefoxProfile class.
public FirefoxProfile()
FirefoxProfile(string)
Initializes a new instance of the FirefoxProfile class using a specific profile directory.
public FirefoxProfile(string profileDirectory)
Parameters
profileDirectory
stringThe directory containing the profile.
FirefoxProfile(string, bool)
Initializes a new instance of the FirefoxProfile class using a specific profile directory.
public FirefoxProfile(string profileDirectory, bool deleteSourceOnClean)
Parameters
profileDirectory
stringThe directory containing the profile.
deleteSourceOnClean
boolDelete the source directory of the profile upon cleaning.
Properties
AcceptUntrustedCertificates
Gets or sets a value indicating whether Firefox should accept SSL certificates which have expired, signed by an unknown authority or are generally untrusted. Set to true by default.
public bool AcceptUntrustedCertificates { get; set; }
Property Value
AlwaysLoadNoFocusLibrary
Gets or sets a value indicating whether to always load the library for allowing Firefox to execute commands without its window having focus.
public bool AlwaysLoadNoFocusLibrary { get; set; }
Property Value
Remarks
The AlwaysLoadNoFocusLibrary property is only used on Linux.
AssumeUntrustedCertificateIssuer
Gets or sets a value indicating whether Firefox assume untrusted SSL certificates come from an untrusted issuer or are self-signed. Set to true by default.
public bool AssumeUntrustedCertificateIssuer { get; set; }
Property Value
Remarks
Due to limitations within Firefox, it is easy to find out if a certificate has expired or does not match the host it was served for, but hard to find out if the issuer of the certificate is untrusted. By default, it is assumed that the certificates were not issued from a trusted certificate authority.
If you receive an "untrusted site" prompt it Firefox when using a certificate that was issued by valid issuer, but the certificate has expired or is being served served for a different host (e.g. production certificate served in a testing environment) set this to false.
DeleteAfterUse
Gets or sets a value indicating whether to delete this profile after use with the FirefoxDriver.
public bool DeleteAfterUse { get; set; }
Property Value
EnableNativeEvents
Gets or sets a value indicating whether native events are enabled.
public bool EnableNativeEvents { get; set; }
Property Value
Port
Gets or sets the port on which the profile connects to the WebDriver extension.
public int Port { get; set; }
Property Value
ProfileDirectory
Gets the directory containing the profile.
public string ProfileDirectory { get; }
Property Value
Methods
AddExtension(string)
Adds a Firefox Extension to this profile
public void AddExtension(string extensionToInstall)
Parameters
extensionToInstall
stringThe path to the new extension
Clean()
Cleans this Firefox profile.
public void Clean()
Remarks
If this profile is a named profile that existed prior to launching Firefox, the Clean() method removes the WebDriver Firefox extension. If the profile is an anonymous profile, the profile is deleted.
FromBase64String(string)
Converts a base64-encoded string into a FirefoxProfile.
public static FirefoxProfile FromBase64String(string base64)
Parameters
base64
stringThe base64-encoded string containing the profile contents.
Returns
- FirefoxProfile
The constructed FirefoxProfile.
SetPreference(string, bool)
Sets a preference in the profile.
public void SetPreference(string name, bool value)
Parameters
SetPreference(string, int)
Sets a preference in the profile.
public void SetPreference(string name, int value)
Parameters
SetPreference(string, string)
Sets a preference in the profile.
public void SetPreference(string name, string value)
Parameters
SetProxyPreferences(Proxy)
Set proxy preferences for this profile.
public void SetProxyPreferences(Proxy proxy)
Parameters
ToBase64String()
Converts the profile into a base64-encoded string.
public string ToBase64String()
Returns
- string
A base64-encoded string containing the contents of the profile.
WriteToDisk()
Writes this in-memory representation of a profile to disk.
public void WriteToDisk()