mirror of
https://github.com/arkenfox/user.js.git
synced 2025-11-08 09:35:26 +01:00
Updated 3.3 Updater Scripts (markdown)
@@ -9,7 +9,67 @@ blah blah
|
|||||||
|
|
||||||
### :small_orange_diamond: Windows
|
### :small_orange_diamond: Windows
|
||||||
|
|
||||||
blah blah
|
[Download](https://github.com/ghacksuserjs/ghacks-user.js/raw/master/updater.bat) the script and save it in your profile folder. You can run it without any command line arguments and it will backup your current user.js, download the latest ghacks user.js and if it finds a `user-overrides.js` in the same folder it will append that to the user.js.
|
||||||
|
|
||||||
|
!! Unicode encoded override files should be stored without the BOM header !!
|
||||||
|
|
||||||
|
Available command-line parameters (case-insensitive):
|
||||||
|
- `-MultiOverrides`
|
||||||
|
uses any and all .js files in a `user.js-overrides` sub-folder as overrides instead of the default `user-overrides.js` file. Files are appended in alphabetical order.
|
||||||
|
- `-unattended`
|
||||||
|
runs the script without user-input
|
||||||
|
- `-updatebatch`
|
||||||
|
the updater will auto-update itself on execution
|
||||||
|
- `-log`
|
||||||
|
writes the console output to the logfile `user.js-update-log.txt`
|
||||||
|
- `-LogP`
|
||||||
|
works just like `-Log` but also opens the logfile after updating
|
||||||
|
|
||||||
|
- `-Merge`
|
||||||
|
merges overrides instead of appending them. Comments are appended normally. `_user.js.parrot` lines are not merged. Overrides for inactive (commented out) user.js prefs will be appended.
|
||||||
|
When `-Merge` and `-MultiOverrides` are used together, a `user-overrides-merged.js` file is also generated in the root directory for quick reference. It contains only the merged data from override files and can be safely discarded after updating, or used as the new user-overrides.js.
|
||||||
|
When there are conflicting records for the same pref, the value of the last one declared will be used.
|
||||||
|
~~Lastly, `-merge` doesn't like exclamation marks (`!`) in pref-values or comments behind user_pref overrides! If a pref-value needs them or you can't live without a ton of `!!!`s in your user_pref override comments, you can prepend a TAB or a JS multi-line-comment which will then append that line instead of trying to merge it.~~ (EDIT: fixed in v4.0)
|
||||||
|
|
||||||
|
The following example illustrates how `-merge` works:
|
||||||
|
ghacks user.js file contains this:
|
||||||
|
```js
|
||||||
|
/* 0103: set your "home" page (see 0102) ***/
|
||||||
|
// user_pref("browser.startup.homepage", "https://www.example.com/");
|
||||||
|
/* 1202: control TLS versions with min and max ***/
|
||||||
|
user_pref("security.tls.version.max", 4); // 4 = allow up to and including TLS 1.3
|
||||||
|
/* 2503: disable giving away network info (FF31+) */
|
||||||
|
user_pref("dom.netinfo.enabled", false);
|
||||||
|
```
|
||||||
|
user-overrides.js:
|
||||||
|
```js
|
||||||
|
/*** my user.js overrides ***/
|
||||||
|
user_pref("browser.startup.homepage", "https://www.foo.bar/"); // 01xx
|
||||||
|
user_pref("security.tls.version.max", 3); // ghacks has 4 (=TLS1.3) but I prefer 3 for now
|
||||||
|
user_pref("dom.netinfo.enabled", false); // 25xx - enforcing false
|
||||||
|
```
|
||||||
|
final user.js after update + merging:
|
||||||
|
```js
|
||||||
|
/* 0103: set your "home" page (see 0102) ***/
|
||||||
|
// user_pref("browser.startup.homepage", "https://www.example.com/");
|
||||||
|
/* 1202: control TLS versions with min and max ***/
|
||||||
|
user_pref("security.tls.version.max", 3); // ghacks has 4 (=TLS1.3) but I prefer 3 for now
|
||||||
|
/*** 4600: RFP (4500) ALTERNATIVES [SETUP] ***/
|
||||||
|
/* [NOTE] ESR52.x and non-RFP users replace the * with a slash on this line to enable these
|
||||||
|
// 4607: [2503] disable giving away network info (FF31+)
|
||||||
|
user_pref("dom.netinfo.enabled", false); // 25xx - enforcing false
|
||||||
|
// ***/
|
||||||
|
|
||||||
|
/*** my user.js overrides ***/
|
||||||
|
user_pref("browser.startup.homepage", "https://www.foo.bar/"); // 01xx
|
||||||
|
```
|
||||||
|
|
||||||
|
With `-merge` it's best to always add a comment behind your overrides to make them easily noticeable when you compare your new user.js with user.js.bak. A good way is to use the number of the pref's section. That will also make it easier to spot when a pref you want to override gets moved to a commented-out section like `9999: DEPRECATED` or `4600: RFP ALTERNATIVES`, resulting in your override becoming inactive, which may or may not be what you want. (see `dom.netinfo.enabled` in the example) If that's not what you want, you can prepend the `dom.netinfo.enabled` line with a TAB or JS multi-line-comment (or in v4.0 one or more spaces also works), like this:
|
||||||
|
```js
|
||||||
|
user_pref("dom.netinfo.enabled", false); // 25xx - enforcing false -- prepended with a TAB
|
||||||
|
/* !!! */ user_pref("dom.netinfo.enabled", false); // 25xx - enforcing false -- or a JS-multi-line comment
|
||||||
|
user_pref("dom.netinfo.enabled", false); // 25xx - enforcing false -- for v4.0 space(s) also works
|
||||||
|
```
|
||||||
|
|
||||||
### :small_orange_diamond: Caveats
|
### :small_orange_diamond: Caveats
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user