@@ -39,6 +39,7 @@ Mozilla Firefox is a free and open-source web browser developed by Mozilla Found
3939 * [ Shell Access] ( #shell-access )
4040 * [ Increasing Shared Memory Size] ( #increasing-shared-memory-size )
4141 * [ Sound Support] ( #sound-support )
42+ * [ Setting Firefox Preferences Via Environment Variables] ( #setting-firefox-preferences-via-environment-variables )
4243 * [ Troubleshooting] ( #troubleshooting )
4344 * [ Crashes] ( #crashes )
4445 * [ Support or Contact] ( #support-or-contact )
@@ -460,6 +461,42 @@ For Firefox to be able to use the audio device available on
460461the host, ` /dev/snd ` must be exposed to the container by adding the
461462` --device /dev/snd ` parameter to the ` docker run ` command.
462463
464+ ## Setting Firefox Preferences Via Environment Variables
465+
466+ Firefox preferences can be set via environment variables
467+ passed to the containter. During the startup, a script process all these
468+ variables and modify the preference file accordingly.
469+
470+ The name of the environment variable must start with ` FF_PREF_ ` , followed by a
471+ string of your choice. For example, ` FF_PREF_MY_PREF ` is a valid name.
472+
473+ The content of the variable should be in the format ` NAME=VAL ` , where ` NAME ` is
474+ the name of the preference (as found in the ` about:config ` page) and ` VAL ` is
475+ its value. A value can be one of the following type:
476+ - string
477+ - integer
478+ - boolean
479+ It is important to note that a value of type ` string ` should be surrounded by
480+ double quotes. Other types don't need them.
481+
482+ For example, to set the ` network.proxy.http ` preference, one would pass the
483+ environment variable to the container by adding the following argument to the
484+ ` docker run ` command:
485+
486+ ```
487+ -e "FF_PREF_HTTP_PROXY=network.proxy.http=\"proxy.example.com\""
488+ ```
489+
490+ If a preference needs to be * removed* , its value should be set to ` UNSET ` . For
491+ example:
492+
493+ ```
494+ -e "FF_PREF_HTTP_PROXY=network.proxy.http=UNSET
495+ ```
496+
497+ ** NOTE** : This is an advanced usage and it is recommended to set preferences
498+ via Firefox directly.
499+
463500## Troubleshooting
464501
465502### Crashes
0 commit comments