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
DeleteAfterUse
Gets or sets a value indicating whether to delete this profile after use with the FirefoxDriver.
public bool DeleteAfterUse { 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
Exceptions
- ArgumentNullException
If
extensionToInstall
is null.
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
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()