nsIProfile

The Profile Manager is responsible for creating, maintaining, and organizing user profiles. This interface was superseded by the nsIToolkitProfileService interface in Gecko 1.8.1.
66
Introduced
Gecko 0.9
Deprecated
Gecko 1.8.1
Obsolete
Gecko 20.0
Inherits from: nsISupports Last changed in Gecko 1.6

Implemented by: @mozilla.org/profile/manager;1. To get access to the Profile Manager service:

var profile = Components.classes["@mozilla.org/profile/manager;1"]
              .getService(Components.interfaces.nsIProfile);
Note: This interface was used by SeaMonkey up through SeaMonkey 1.1 versions, which were based off Gecko 1.8.1. However, it hasn't been used in Firefox since before Firefox 1.0.

Method overview

void cloneProfile(in wstring profileName);
void createNewProfile(in wstring profileName, in wstring nativeProfileDir, in wstring langcode, in boolean useExistingDir);
void deleteProfile(in wstring name, in boolean canDeleteFiles);
void getProfileList(out unsigned long length, [retval, array, size_is(length)] out wstring profileNames);
boolean profileExists(in wstring profileName);
void renameProfile(in wstring oldName, in wstring newName);
void shutDownCurrentProfile(in unsigned long shutDownType);

Attributes

Attribute Type Description
currentProfile wstring The name of the profile currently in use.
profileCount long The number of profiles. Read only.

Constants

Profile shutdown types

Constant Value Description
SHUTDOWN_PERSIST 0x00000001 When shutting down the profile, save all changes.
SHUTDOWN_CLEANSE 0x00000002 When shutting down the profile, discard changes. Unimplemented

Methods

cloneProfile()

Clones the current profile, creating a copy of it with a new name.

void cloneProfile(
  in wstring profileName
);
Parameters
profileName
The name to assign to the new clone of the current profile.

createNewProfile()

Creates a new profile. Appropriate default values will be copied into the preferences in the new profile.

void createNewProfile(
  in wstring profileName,
  in wstring nativeProfileDir,
  in wstring langcode,
  in boolean useExistingDir
);
Parameters
profileName
The name to assign to the new profile.
nativeProfileDir
The pathname of the directory to use as the profile directory; if you specify null, a new folder will be created in the default profiles directory.
langcode
The locale to use for the new profile.
useExistingDir
If true, an existing directory may be used; otherwise, the profile directory will be unique.

deleteProfile()

Deletes the specified profile.

void deleteProfile(
  in wstring name,
  in boolean canDeleteFiles
);
Parameters
name
The name of the profile to delete.
canDeleteFiles
If true, the Profile Manager will try to delete all of the profile's files and its directory.

getProfileList()

Returns an array of strings indicating the names of all the available profiles.

void getProfileList(
  out unsigned long length,
  [retval, array, size_is(length)] out wstring profileNames
);
Parameters
length
On return, contains the number of profiles in the profileNames array.
profileNames
On return, contains an array of all of the available profiles' names.

profileExists()

Determine whether or not a profile with the specified name exists.

boolean profileExists(
  in wstring profileName
);
Parameters
profileName
The name of the profile to look for.
Return value

true if there is a profile with the specified name.

renameProfile()

Renames an existing profile.

void renameProfile(
  in wstring oldName,
  in wstring newName
);
Parameters
oldName
The name of the profile to rename.
newName
The new name to assign to the profile.
Exceptions thrown
NS_ERROR_FAILURE
A profile already exists with the name newName.

shutDownCurrentProfile()

Shuts down the current profile; this essentially "logs out" the current profile.

void shutDownCurrentProfile(
  in unsigned long shutDownType
);
Parameters
shutDownType
The type of shutdown to perform; see Shutdown type constants.

See also