summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/docs/mozprofile.rst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/mozbase/docs/mozprofile.rst
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--testing/mozbase/docs/mozprofile.rst94
1 files changed, 94 insertions, 0 deletions
diff --git a/testing/mozbase/docs/mozprofile.rst b/testing/mozbase/docs/mozprofile.rst
new file mode 100644
index 0000000000..d5b6e351b9
--- /dev/null
+++ b/testing/mozbase/docs/mozprofile.rst
@@ -0,0 +1,94 @@
+:mod:`mozprofile` --- Create and modify Mozilla application profiles
+====================================================================
+
+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.
+
+The preferred way of setting up profile data (addons, permissions, preferences
+etc) is by passing them to the profile_ constructor.
+
+Addons
+------
+
+.. automodule:: mozprofile.addons
+ :members:
+
+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"])
+
+Command Line Interface
+----------------------
+
+.. automodule:: mozprofile.cli
+ :members:
+
+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.
+
+Permissions
+-----------
+
+.. automodule:: mozprofile.permissions
+ :members:
+
+You can set permissions by creating a ``ServerLocations`` object that you pass
+to the ``Profile`` constructor. Hosts can be added to it with
+``add_host(host, port)``. ``port`` can be 0.
+
+Preferences
+-----------
+
+.. automodule:: mozprofile.prefs
+ :members:
+
+Preferences can be set in several ways:
+
+- using the API: You can make a dictionary with the preferences and pass it to
+ the ``Profile`` constructor. You can also add more preferences with the
+ ``Profile.set_preferences`` method.
+- 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.
+
+Profile
+--------------------
+
+.. automodule:: mozprofile.profile
+ :members:
+
+Resources
+-----------
+Other Mozilla programs offer additional and overlapping functionality
+for profiles. There is also substantive documentation on profiles and
+their management.
+
+- profile documentation_
+
+
+.. _Mozprofile: https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozprofile
+.. _addons: https://developer.mozilla.org/en/addons
+.. _mozprofile.profile: https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozprofile/mozprofile/profile.py
+.. _AddonManager: https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozprofile/mozprofile/addons.py
+.. _here: https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/mozprofile/mozprofile/permissions.py
+.. _documentation: http://support.mozilla.com/en-US/kb/Profiles