Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 :mod:`mozprofile` --- Create and modify Mozilla application profiles
2 ====================================================================
4 Mozprofile_ is a python tool for creating and managing profiles for Mozilla's
5 applications (Firefox, Thunderbird, etc.). In addition to creating profiles,
6 mozprofile can install addons_ and set preferences_ Mozprofile can be utilized
7 from the command line or as an API.
9 The preferred way of setting up profile data (addons, permissions, preferences
10 etc) is by passing them to the profile_ constructor.
12 Addons
13 ------
15 .. automodule:: mozprofile.addons
16 :members:
18 Addons may be installed individually or from a manifest.
20 Example::
22 from mozprofile import FirefoxProfile
24 # create new profile to pass to mozmill/mozrunner
25 profile = FirefoxProfile(addons=["adblock.xpi"])
27 Command Line Interface
28 ----------------------
30 .. automodule:: mozprofile.cli
31 :members:
33 The profile to be operated on may be specified with the ``--profile``
34 switch. If a profile is not specified, one will be created in a
35 temporary directory which will be echoed to the terminal::
37 (mozmill)> mozprofile
38 /tmp/tmp4q1iEU.mozrunner
39 (mozmill)> ls /tmp/tmp4q1iEU.mozrunner
40 user.js
42 To run mozprofile from the command line enter:
43 ``mozprofile --help`` for a list of options.
45 Permissions
46 -----------
48 .. automodule:: mozprofile.permissions
49 :members:
51 You can set permissions by creating a ``ServerLocations`` object that you pass
52 to the ``Profile`` constructor. Hosts can be added to it with
53 ``add_host(host, port)``. ``port`` can be 0.
55 Preferences
56 -----------
58 .. automodule:: mozprofile.prefs
59 :members:
61 Preferences can be set in several ways:
63 - using the API: You can make a dictionary with the preferences and pass it to
64 the ``Profile`` constructor. You can also add more preferences with the
65 ``Profile.set_preferences`` method.
66 - using a JSON blob file: ``mozprofile --preferences myprefs.json``
67 - using a ``.ini`` file: ``mozprofile --preferences myprefs.ini``
68 - via the command line: ``mozprofile --pref key:value --pref key:value [...]``
70 When setting preferences from an ``.ini`` file or the ``--pref`` switch,
71 the value will be interpolated as an integer or a boolean
72 (``true``/``false``) if possible.
74 Profile
75 --------------------
77 .. automodule:: mozprofile.profile
78 :members:
80 Resources
81 -----------
82 Other Mozilla programs offer additional and overlapping functionality
83 for profiles. There is also substantive documentation on profiles and
84 their management.
86 - ProfileManager_: XULRunner application for managing profiles. Has a GUI and CLI.
87 - python-profilemanager_: python CLI interface similar to ProfileManager
88 - profile documentation_
91 .. _Mozprofile: https://github.com/mozilla/mozbase/tree/master/mozprofile
92 .. _addons: https://developer.mozilla.org/en/addons
93 .. _preferences: https://developer.mozilla.org/En/A_Brief_Guide_to_Mozilla_Preferences
94 .. _mozprofile.profile: https://github.com/mozilla/mozbase/tree/master/mozprofile/mozprofile/profile.py
95 .. _AddonManager: https://github.com/mozilla/mozbase/tree/master/mozprofile/mozprofile/addons.py
96 .. _here: https://github.com/mozilla/mozbase/blob/master/mozprofile/mozprofile/permissions.py
97 .. _ProfileManager: https://developer.mozilla.org/en/Profile_Manager
98 .. _python-profilemanager: http://k0s.org/mozilla/hg/profilemanager/
99 .. _documentation: http://support.mozilla.com/en-US/kb/Profiles