Skip to main content

handling of Mozilla XUL app profiles

Project description

[Mozprofile](https://github.com/mozilla/mozbase/tree/master/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](https://developer.mozilla.org/en/addons) and set [preferences](https://developer.mozilla.org/En/A_Brief_Guide_to_Mozilla_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.

# API Usage

To use mozprofile as an API you can import [mozprofile.profile](https://github.com/mozilla/mozbase/tree/master/mozprofile/mozprofile/profile.py) and/or the [AddonManager](https://github.com/mozilla/mozbase/tree/master/mozprofile/mozprofile/addons.py).

mozprofile.profile features a generic Profile class. In addition, subclasses FirefoxProfile and ThundebirdProfile are available with preset preferences for those applications.

# Installing Addons

Addons may be installed individually or from a manifest.

Example:

from mozprofile import FirefoxProfile

# create new profile to pass to mozmill/mozrunner profile = FirefoxProfile(addons=[“adblock.xpi”])

# Setting Preferences

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 .ini file: 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 (true/false) if possible.

# Setting Permissions

mozprofile also takes care of adding permissions to the profile. See https://github.com/mozilla/mozbase/blob/master/mozprofile/mozprofile/permissions.py

# Resources

Other Mozilla programs offer additional and overlapping functionality for profiles. There is also substantive documentation on profiles and their management.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mozprofile-0.1b2.tar.gz (14.7 kB view details)

Uploaded Source

File details

Details for the file mozprofile-0.1b2.tar.gz.

File metadata

  • Download URL: mozprofile-0.1b2.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mozprofile-0.1b2.tar.gz
Algorithm Hash digest
SHA256 2a3220eecc6fffc7fd225f806ef0fc148b22765d91165b5d4b21890e09c09e27
MD5 721399c35f879c8e40eeba62871dacaf
BLAKE2b-256 62a8ffcf6b5379dbd5a40f507a990eca19688274e583202cc892335366b27692

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page