Bug 1877642 - Disable browser_fullscreen-tab-close-race.js on apple_silicon !debug...
[gecko.git] / testing / mozbase / docs / mozprofile.rst
blobd5b6e351b9ce2eb7d5a65d83fbc365c837087939
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
23         
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 - profile documentation_
89 .. _Mozprofile: https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozprofile
90 .. _addons: https://developer.mozilla.org/en/addons
91 .. _mozprofile.profile: https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozprofile/mozprofile/profile.py
92 .. _AddonManager: https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozprofile/mozprofile/addons.py
93 .. _here: https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozprofile/mozprofile/permissions.py
94 .. _documentation: http://support.mozilla.com/en-US/kb/Profiles