1
0
mirror of https://github.com/yokoffing/Betterfox.git synced 2026-06-12 15:40:48 +05:30

Updated Advanced Configuration (markdown)

HJ
2023-09-08 14:13:35 -04:00
parent 16d3c9ad79
commit 27db8a4180
+117 -1
@@ -1 +1,117 @@
WIP
## Download
Different download methods are available:
* Clone using git: `git clone https://github.com/yokoffing/Betterfox`
* Download and extract the [ZIP file](https://github.com/yokoffing/Betterfox/archive/main.zip) containing the latest version.
* Download the latest `user.js` [directly](https://raw.githubusercontent.com/yokoffing/Betterfox/main/user.js)
## Installation
### Backups
Do note that these settings alter your browser behaviour quite a bit, so it is recommended to either create a completely new [profile][https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data] for Firefox or backup your existing [profile directory](http://kb.mozillazine.org/Profile_folder_-_Firefox) before putting the `user.js` file in place.
To enable the Profile Manager, run Firefox with [command-line arguments](http://kb.mozillazine.org/Command_line_arguments): `firefox --no-remote -P`
### Single profile installation
Copy `user.js` in your current user profile directory, or (recommended) to a fresh, newly created Firefox profile directory.
The file should be located at:
| OS | Path |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Windows | `%APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.your_profile_name\user.js` |
| macOS | `~/Library/Application Support/Firefox/Profiles/XXXXXXXX.your_profile_name` |
| Linux | `~/.mozilla/firefox/XXXXXXXX.your_profile_name/user.js` |
| Android | `/data/data/org.mozilla.firefox/files/mozilla/XXXXXXXX.your_profile_name` |
| Windows (portable) | `[firefox directory]\Data\profile\` |
With this installation method, if you change any of `user.js` settings through [`about:config`](http://kb.mozillazine.org/About:config) or Firefox preferences dialogs, they will be reset to the `user.js` defined values after you restart Firefox. This makes sure they're always back to secure defaults when starting the browser. However this prevents persistently changing settings you don't consider appropriate. Either edit `user.js` directly, or use the system-wide installation method described below.
### System-wide installation (all platforms)
Generate a file suitable for system-wide installation, by running `make` with one of the following targets:
* `systemwide_user.js`: (the value will be used as default value for all Firefox Profiles where it is not explicitly set, it can be changed in `about:config` and is kept across browser sessions)
* `locked_user.js`: (the value will be used as default value on Firefox profile creation, will be locked and can't be changed) in `user.js` or in Firefox's `about:config` or settings.
* `debian_locked.js`: Debian specific. Users are not able to override preferences. See [#415](https://github.com/pyllyukko/user.js/issues/415).
Copy the produced file to the Firefox installation directory. The file should be located at:
| OS | Path |
| ------------------------- | ---------------------------------------------------------------------------- |
| Windows | `C:\Program Files\Mozilla Firefox\mozilla.cfg` |
| macOS | `/Applications/Firefox.app/Contents/Resources/mozilla.cfg` |
| Linux | `/etc/firefox/syspref.js`, for older versions: `/etc/firefox/firefox.js` |
| Linux (Debian) | `/etc/firefox-esr/firefox-esr.js` |
| Linux (Gentoo, Archlinux) | `/usr/lib/firefox/mozilla.cfg`, might also be `/usr/lib32/` or `/usr/lib64/` |
#### Additional installation steps for Windows / OS X / Gentoo / Archlinux
Create `local-settings.js` in Firefox installation directory, with the following contents:
```
pref("general.config.obscure_value", 0);
pref("general.config.filename", "mozilla.cfg");
```
This file should be located at:
| OS | Path |
| ------------------------- | ------------------------------------------------------------------------------- |
| Windows | `C:\Program Files\Mozilla Firefox\defaults\pref\` |
| macOS | `/Applications/Firefox.app/Contents/Resources/defaults/pref` |
| Linux (Gentoo, Archlinux) | `/usr/lib/firefox/defaults/pref/`, might also be `/usr/lib32/` or `/usr/lib64/` |
If `mozilla.cfg` still fails to load, you must add a blank comment to the top of `mozilla.cfg` like so:
```
//
```
## Custom policies.json (optional)
Enterprise policies are a way of enforcing browser behavior in an enterprise environment, but can be used by users to do the same. Unlike group policies, policies.json is cross-platform. I have made my own, just like the user.js file, this one can also be found in [my repository](https://github.com/yokoffing/Betterfox/blob/main/policies.json).
WARNING: These policies are enforced and are usually not modifiable within Firefox. Make sure you go through the file and learn what it does before you use it!
Applying the policies.json file
Download my [policies.json](https://raw.githubusercontent.com/Kellegram/my-firefox-setup/master/policies.json) (Right click > Save Page As…).
Follow instructions for your platform (this is best done if Firefox was never launched, at least on the profile you use):
Microsoft Windows: create a directory called “distribution” where the firefox.exe file is located and place the file “policies.json” there.
Apple macOS: create a directory called “distribution” in Firefox.app/Contents/Resources/ and place the file “policies.json” there.
Linux: create a directory called “distribution” in the directory where Firefox is located and place the file “policies.json” there.
### Additional settings (policies)
Not all Firefox settings can be changed through `user.js` - some must be set in a separate **policies.json** [file](https://support.mozilla.org/en-US/products/firefox-enterprise/policies-customization-enterprise/policies-overview-enterprise). These policies apply system-wide.
To install [policies.json](https://github.com/yokoffing/Betterfox/blob/main/policies.json) from this repository, simply copy it to the appropriate directory (create it if it does not exist):
| OS | Path |
| ------------------------- | ------------------------------------------------------------------------------- |
| Windows | `C:\Program Files\Mozilla Firefox\distribution\` |
| macOS | `/Applications/Firefox.app/distribution\` |
| Linux (Debian) | `/etc/firefox-esr/policies/` |
Note that JSON does not support comments, hence settings are documented in custom `*_comment` keys. Mozilla maintains a list of available policies: [[1]](https://mozilla.github.io/policy-templates/) [[2]](https://github.com/mozilla/policy-templates). The [Enterprise Policy Generator](https://addons.mozilla.org/en-US/firefox/addon/enterprise-policy-generator/) add-on can be used to generate `policies.json` files from a graphical interface.
### Updating using git
For any of the above methods, you can keep your browser's `user.js` with the latest version available here: Clone the repository, and create a symbolic link from the appropriate location to the `user.js` file in the repository. Just run `git pull` in the repository when you want to update, then restart Firefox:
```
cd ~/.mozilla/firefox
git clone 'https://github.com/yokoffing/Betterfox.git'
cd XXXXXXXX.your_profile_name
ln -s ../Betterfox/user.js user.js
```
### Verifying
Verify that the settings are effective from [about:support](http://kb.mozillazine.org/Troubleshooting_Information_report#Modified_Preferences) (check the "Important Modified Preferences" and "user.js Preferences" sections).
Verify that policies are effective from [about:policies](https://support.mozilla.org/en-US/kb/see-active-policies-firefox-enterprise).