This documentation is no longer maintained. Please see the maintained documentation of mozprofile at http://mozbase.readthedocs.org/en/latest/mozprofile.html.
Mozprofile is a python tool for creating and managing profiles for Mozilla's applications (Firefox, Thunderbird, etc.). In addition to creating profiles, mozprofile can install addons and set preferences.
Mozprofile can be utilized from the command line or as an API.
Command Line Usage
mozprofile may be used to create profiles, set preferences in profiles, or install addons into profiles.
The profile to be operated on may be specified with the
--profile switch. If a profile is not specified, one will be created in a temporary directory which will be echoed to the terminal:
(mozmill)> mozprofile /tmp/tmp4q1iEU.mozrunner (mozmill)> ls /tmp/tmp4q1iEU.mozrunner user.js
To run mozprofile from the command line enter:
mozprofile --help for a list of options.
mozprofile.profile features a generic
Profile class. In addition, subclasses
ThundebirdProfile are available with preset preferences for those applications.
Addons may be installed individually or from a manifest.
from mozprofile import FirefoxProfile # create new profile to pass to mozmill/mozrunner profile = FirefoxProfile(addons=["adblock.xpi"])
Preferences can be set in several ways:
- using the API: You can pass preferences in to the Profile class's constructor:
obj = FirefoxProfile(preferences=[("accessibility.typeaheadfind.flashBar", 0)])
- using a JSON blob file:
mozprofile --preferences myprefs.json
- using a
mozprofile --preferences myprefs.ini
- via the command line:
mozprofile --pref key:value --pref key:value [...]
When setting preferences from an
.ini file or the
--pref switch, the value will be interpolated as an integer or a boolean (
false) if possible.
mozprofile also takes care of adding permissions to the profile. See https://github.com/mozilla/mozbase/b...permissions.py
Other Mozilla programs offer additional and overlapping functionality for profiles. There is also substantive documentation on profiles and their management.