Compare commits

..

160 Commits
73.0 ... 82.0

Author SHA1 Message Date
5b0d173078 82 final 2020-11-13 00:55:45 +00:00
d6186819f4 domIntersectionObserver
it was removed after 81-beta was released
2020-11-11 18:42:29 +00:00
ea0eb85404 82-beta 2020-11-11 18:23:00 +00:00
8dc43cfdc2 RFP 82+ changes
Note
 - this is not the same as 2517 which disables the API
 - RFP does not determine what is supported or not supported: so that entropy remains
 - with or without RFP, if the media config is not supported it returns false,false (so there is nothing to spoof here)
2020-11-11 18:20:13 +00:00
f7bee988de 0517: add creditCards.available / defense-in-depth
see https://github.com/arkenfox/user.js/issues/1038#issuecomment-713643850
2020-11-11 18:08:06 +00:00
f2fe7f02b0 add 2624: window.name protection, fixes #1012 2020-11-11 16:59:27 +00:00
accef19af4 add LSNG, fixes #1059 2020-11-11 16:27:43 +00:00
910d7004c6 release info, fixes #1042
now we have somewhere to add things like HTTPS-Only Mode, appCache, secure downloads when we make changes that impact ESR
2020-11-11 16:12:57 +00:00
07cccd5386 remove 4003: partition, see #1051 (#1057) 2020-11-02 17:05:40 +00:00
ac52886ea8 2422 WASM, add reason for disabling, fixes #1037 (#1054) 2020-10-26 10:37:49 +00:00
c45780d79b 0701 PHP localhost + IPv6, fixes #1053 2020-10-26 10:34:54 +00:00
e14732aad3 2031: better reference: closes #1022 (#1048) 2020-10-23 23:29:31 +00:00
26d4768447 add media.autoplay.blocking_policy 2020-10-21 13:44:21 +00:00
9f99885272 clean up acknowledgments 2020-10-20 12:57:00 +00:00
0adfddd1e2 misc (#1040)
* misc

- cleanup of old release notation in comments: e.g. if it's not applicable to ESR78+
- same with default version info
- simplify and save bytes on section 4700
- update 4500 header
  - and unify the message about using extensions as counterproductive
- letterboxing
   - provide info on stepped ranged (and drop crap about FF67)
   - don't judge users who dislike seeing margins (I don't like them either, but I force my window to exact dimensions and stay there)
- screenshots uploading was disabled in FF67+ : [67 release notes](https://www.mozilla.org/en-US/firefox/67.0/releasenotes/)
   - the pref is still there (default false) but so far I'm 99% sure this pref now does anything
   - I will add it to the scatchpad script if this change sticks

* simplify 4500 RFP, see #1041

* update removed script

* tidy readme, see #1045

- also put readme before releases

* RIP FX Site Compat

* clean out RFP Alts info: the information is redundant: it's already in the readme
2020-10-20 11:58:20 +00:00
f591a8adf8 82-alpha, 82 deprecated, remove old deprecated 2020-10-13 14:12:53 +00:00
0e10a820d9 81 final 2020-10-13 14:01:41 +00:00
c90341dded 1244: HTTPS-Only mode update (#1031) 2020-10-07 12:10:24 +00:00
d5ccf4693b fixup font prefs vs RFP, fixes #1025 (#1028)
- make 1401 inactive: it affects RFP's FPing
- remove old warning/setup-web: we do not care about documenting breakage or FPing risks when we have a warning and they are inactive. If someone uses them, that's on them
- new warnings
2020-10-06 13:43:51 +00:00
e89f9a5d89 dom.IntersectionObserver.enabled
commit: a56ba85936
issue: #1026
2020-10-02 08:36:15 +00:00
a56ba85936 remove dom.IntersectionObserver.enabled #1026
- this was made inactive in v68
- since at least FF79, when active as false, it breaks the web and browser consoles
- it breaks websites
- it breaks extensions: e.g. uBO panel functionality
- it does nothing to mitigate possible fingerprinting (which was why it was initially added as a concern) - i.e the API only provided a standardized method, it does not stop previous/earlier workarounds
2020-10-02 08:33:27 +00:00
421f1e361c [ ] are for for prefs only 2020-09-29 06:10:57 +00:00
2391874e04 UI setting change in 81
https://bugzilla.mozilla.org/show_bug.cgi?id=1613468
2020-09-28 19:04:08 +00:00
4779ea7850 remove CSP issue, closes #1021 2020-09-27 00:47:09 +00:00
c367beabe3 81-beta 2020-09-23 12:20:59 +00:00
e1d336a178 standardize some error codes
* 0 : successful termination
* 2 : command line syntax error
* 1 : catchall for general errors

Plus a few text improvements based on unmerged PR 4fbb2be98d
2020-09-15 13:36:39 +00:00
ee3e5f0186 v4.12: arkenfox 2020-09-15 12:04:54 +00:00
42b7650d42 v2.8: arkenfox 2020-09-15 11:58:52 +00:00
f61d4a0d38 Update prefsCleaner.sh 2020-09-15 11:55:28 +00:00
7fe9784bf8 we no longer have github pages 2020-09-15 06:18:54 +00:00
ed05c64482 we no longer have github pages 2020-09-15 06:18:33 +00:00
16c3658040 align look with TZP 2020-09-15 06:17:44 +00:00
515d6ff874 v2.3: update repo name 2020-09-15 06:11:35 +00:00
fc65052286 migration: cleanup code references 2020-09-15 06:07:32 +00:00
6a107d4d2f migration: cleanup code references 2020-09-15 06:06:32 +00:00
eff4b74130 migration: cleanup code references 2020-09-15 06:05:33 +00:00
2532ddcc18 update name 2020-09-15 05:59:51 +00:00
44e22835c1 update name 2020-09-15 05:58:39 +00:00
1f545312fd update names + links 2020-09-15 05:57:30 +00:00
637e5964db update links 2020-09-15 05:56:00 +00:00
26bca612d7 rename as arkenfox 2020-09-15 05:54:22 +00:00
6fdda5fb62 rename as arkenfox 2020-09-15 05:53:09 +00:00
ed5b158777 Rename ghacks-clear-RFP-alternatives.js to arkenfox-clear-RFP-alternatives.js 2020-09-15 05:52:28 +00:00
4c4270f1d7 migration changes 2020-09-15 04:33:50 +00:00
af51631597 Update LICENSE.txt 2020-09-15 04:19:03 +00:00
ae0c980d25 migration 2020-09-15 04:15:03 +00:00
3e4c56cf27 arkenfox support
also fixes mixed line endings
2020-09-13 12:16:21 +00:00
18112f9ae8 last F time :) update TZP links 2020-09-11 21:55:12 +00:00
c8eee094e0 update links 2020-09-11 03:23:55 +00:00
78a7c194eb update ref links 2020-09-10 07:33:50 +00:00
f606c8b866 2203 values
see https://bugzilla.mozilla.org/show_bug.cgi?id=1663500 where they reverted https://bugzilla.mozilla.org/show_bug.cgi?id=1661643 where they said value 1 didn't do anything - all changes in FF82, so nothing to see here folks ... move along
2020-09-08 23:49:22 +00:00
9c98972d14 misc2 (#1010)
* forceMediaMemoryCache breakage

* add back ESR68-EOL for prefsCleaner users
2020-09-05 15:42:34 +00:00
75a03df0f7 miscellaneous (#1007)
- less active prefs
   - now that ESR68 is EOL, at least a whopping two (0602, 1273)
   - also I don't know when the default changed - another whopping whole one (1240)
   - and where we do enforce/reset a pref to default, lets say that
   - this is not a definitive list, sing out if there is anything else
- IPv6 info
   - especially for Iron Heart who likes to claim that this pref breaks 5% of sites
- cleanup of settings tags now we only care abut ESR78+
2020-09-05 15:20:46 +00:00
76019e6fbe ESR78 unhidden prefs
also, the note about WebExt + SVG only applies to people using outdated versions .. so that can go too
2020-09-03 13:27:25 +00:00
3c2bd930c3 start 81-alpha, EOL for ESR68 2020-09-03 13:11:16 +00:00
ed993d5502 80 final 2020-09-03 13:04:31 +00:00
22d2d702be 1409: obsolete RFP mention 2020-09-03 13:02:09 +00:00
8dacf6e91f fix typo (#1005) 2020-08-31 21:47:57 +00:00
fbe1d48fe2 2203: open_newwindow values
- FYI: https://bugzilla.mozilla.org/show_bug.cgi?id=1661643
- https://hg.mozilla.org/integration/autoland/rev/12d62b074178
2020-08-31 19:49:00 +00:00
5fd7f6de7e 80-alpha 2020-08-28 18:27:20 +00:00
592b959c24 Updater.sh rework 2 (#1000)
* rework DOWNLOAD_METHOD, download_file, open_file

* remove legacy command leftover line

* return empty string if download fails and return/exit if this happens and show error message

* fix IFS var typo

* bump version

* add quotes

Co-authored-by: TotallyLeGIT <bbkqx24kxlgvgbss@mailban.de>
2020-08-28 10:51:15 +00:00
c6f53c8768 2201 deprecated (dead prefs removed in 82), #979 (#1002) 2020-08-26 11:28:47 +00:00
38d772e4c8 https-only mode updates (#1001) 2020-08-25 14:59:41 +00:00
cfce521919 1409: RFP changes in FF81+ (#998) 2020-08-23 14:37:18 +00:00
a5ab3e23d6 Update README.md 2020-08-22 22:16:27 +00:00
b3eee6c9fd improve readability, remove lots of unnecessary echo commands, remove legacy arguments (#997)
Co-authored-by: TotallyLeGIT <bbkqx24kxlgvgbss@mailban.de>
2020-08-22 12:07:13 +00:00
8d6d17d46b 1244: HTTPS-only mode: FF80+ site exceptions
The option is not shown if https-only-mode is not being applied. I tested with `http://asmjs.org/` since it doesn't redirect/upgrade to secure.
2020-08-21 21:05:08 +00:00
9a37e1340c 0905: add reference, #982 2020-08-20 17:18:22 +00:00
f1e0203ef4 0105b, cleaner value, see #992 2020-08-15 01:56:01 +00:00
726d5bde30 0105b: stop console error, closes #992 2020-08-14 14:12:28 +00:00
f9f0fffd27 Update README.md 2020-08-14 09:01:14 +00:00
93840ca181 0602 not hidden in ESR78 2020-08-13 15:37:25 +00:00
99aa5af356 password master->primary 2020-08-13 15:34:26 +00:00
0358fdac8b 80-alpha 2020-08-13 15:32:45 +00:00
815c3026b5 79 final 2020-08-13 15:30:36 +00:00
5ed3047b7a references cleanup 2020-08-13 15:22:38 +00:00
e16ede1cdf 79-beta 2020-08-13 14:44:27 +00:00
6905187b3e 0207/0208: region/search (#989) 2020-08-13 04:39:38 +00:00
172118e61b RFP+Alts: fixup sequential numbering, see #987 2020-08-05 01:35:10 +00:00
8452edb94b 4600: see #987 2020-08-04 10:25:29 +00:00
0f6957bbd4 4600: add missing version section 2020-08-04 10:18:29 +00:00
8c2bcc0352 1007: bump to 64mb, see #941 2020-08-03 22:50:58 +00:00
bc832575d8 1003: kibibytes 2020-08-03 14:52:21 +00:00
c4b7e07691 4500: site partitioning 2020-08-02 01:47:48 +00:00
58fb1db838 HTTPS-Only Mode UI 2020-08-02 01:27:30 +00:00
2809854802 font visibility / RFP (#985) 2020-08-01 11:03:17 +00:00
091a71aade browser.urlbar.usepreloadedtopurls.enabled 2020-07-29 02:22:09 +00:00
117ab133b1 remove 0809
not deprecated, just hidden: default is false anyway
2020-07-29 02:19:20 +00:00
c4a06c4689 missing comma 2020-07-23 12:23:14 +00:00
0d27689c64 update to ESR78
and this time add the file extension
2020-07-23 12:22:20 +00:00
771e57480a Delete ghacks-clear-RFP-alternatives 2020-07-23 12:21:10 +00:00
f8fd03482d 79 deprecated 2020-07-23 11:19:49 +00:00
10cc1224d0 Create ghacks-clear-removed.js 2020-07-23 11:00:23 +00:00
52926cca7a Delete ghacks-clear-[removed].js 2020-07-23 10:59:19 +00:00
be64819ce7 update to ESR78 2020-07-23 10:58:22 +00:00
24c228df92 update to ESR78 2020-07-23 10:57:12 +00:00
892b3d9d69 Delete ghacks-clear-FF68inclusive-[deprecated].js 2020-07-23 10:53:38 +00:00
df21798b81 Delete ghacks-clear-FF68inclusive-[RFP-alternatives].js 2020-07-23 10:53:25 +00:00
46d03279d3 79 start, fixup 2429 default info 2020-07-22 12:35:13 +00:00
fe0af3bb34 remove 0709 duplicate, 78 final 2020-07-21 10:40:01 +00:00
84997386c1 78-beta 2020-07-20 05:24:18 +00:00
1a389c0214 dnsResolveSingleWordsAfterSearch (#968) 2020-07-10 10:09:13 +00:00
d0060fed3c 2031: use exceptions if you need to, #969 2020-07-08 13:18:38 +00:00
3d18af19e3 various, #959 (#967)
Co-authored-by: rusty-snake
2020-07-05 14:02:25 +00:00
b5b04454e0 0850a search keywords fixup 2020-07-01 03:46:52 +00:00
618f7bed3f 0850a: add top sites FF78+ 2020-06-29 15:49:11 +00:00
488a825626 update weak ciphers/tests etc, closes #931 (#963)
- adds the new tests including the non-JS JA3

Co-authored-by: rusty-snake <41237666+rusty-snake@users.noreply.github.com>
Co-authored-by: earthlng <earthlng@users.noreply.github.com>
2020-06-28 15:48:13 +00:00
aaf6cb33d7 4617 restart
- at least for disabling chrome animations
2020-06-27 12:37:32 +00:00
77ecef8be3 78 deprecated, add 2032 (#962) 2020-06-27 12:16:57 +00:00
4be0a80720 update trac tor tickets (#958)
and some other minor tweaks
2020-06-24 17:26:25 +00:00
f573200aa8 ciphers in ESR78
[1496639](https://bugzilla.mozilla.org/show_bug.cgi?id=1496639)
2020-06-18 02:29:54 +00:00
48f258ff53 start 78-alpha 2020-06-14 10:28:32 +00:00
b9100488cb 77 final 2020-06-14 10:26:10 +00:00
9d78e050ee 77-beta 2020-06-12 17:39:28 +00:00
b07cf1f03d remove extra line from last commit, save one byte 2020-06-05 03:10:09 +00:00
683ef63b37 RFP alts: prefers-reduced-motion 2020-06-05 03:08:16 +00:00
05580f5e99 0709 hotfix, #923, #951 2020-06-02 20:48:41 +00:00
ecc62554e5 2608: remote debugging: default value, closes #950 2020-06-01 15:27:38 +00:00
f6e6de8444 77 deprecated 2020-05-29 12:41:59 +00:00
f69d92e6dd 1244: https upgrade local 2020-05-29 12:23:17 +00:00
3edc48da56 fix updater.sh when dealing with multiple overrides (#947)
thanks @mloberg !
2020-05-26 11:54:55 +00:00
868882ae33 start 77-alpha 2020-05-24 18:11:55 +00:00
ff9bf76e52 76 final, save some bytes in RFP section 2020-05-24 18:09:46 +00:00
4bc5b89cfe 4500: RFP changes 78+ re canvas 2020-05-15 23:18:11 +00:00
bb1e5bfd54 76-beta 2020-05-07 14:56:49 +00:00
27d72eda9e 1244: https-only-mode 2020-05-07 06:20:10 +00:00
07117c65c1 RFP spoofs FF78+ 2020-05-07 05:13:19 +00:00
919d4bfe96 godamnit, also move related reference 2020-05-04 10:52:25 +00:00
e38e253c25 oophs, forgot deprecation source 2020-05-04 10:49:07 +00:00
14aaec71fb 76 deprecated 2020-05-04 07:34:23 +00:00
c0780df24d 1401: PDF breakage, closes #937 2020-04-30 21:50:50 +00:00
0ea1605642 start 76-alpha, 2605 default 2020-04-30 18:52:27 +00:00
bd384622db Update troubleshooter.js (#935)
extensions.blocklist.pingCountTotal is not used anymore in FF76+
2020-04-29 12:00:10 +00:00
3366e0aa16 75 final 2020-04-23 08:52:48 +00:00
W
dff5bb478a 0211: add possible breakage for CJK input methods 2020-04-16 04:04:13 +00:00
d455c500a6 75-beta 2020-04-15 14:44:14 +00:00
b90e72370c 1007 fixup what FF75+ applies to 2020-04-14 00:28:00 +00:00
dd162d9f48 1007 fixups 2020-04-14 00:16:03 +00:00
d7c276b3fe 2402: clipboardevents -> inactive, #887 2020-04-13 06:17:54 +00:00
394b691599 2421: grammar fix 2020-04-13 04:55:10 +00:00
ba83c555cc geo default search engines
browser.search.geoip.url is deprecated in 75, the prefs are only used on first run, and we don't mess with search engines as that is a user choice
2020-04-12 18:10:34 +00:00
b695468c7e remove 0205 2020-04-12 18:07:12 +00:00
deae6e14f9 75 deprecated 2020-04-12 16:38:12 +00:00
97c5378e52 1007: *forceMediaMemoryCache PB mode 2020-04-12 16:23:48 +00:00
d2dd0c2ab4 tls stats update
- Go to https://telemetry.mozilla.org/
- click `measurement dashboard`
- select `SSL_HANDSHAKE_VERSION`

I looked at Nightly 75 (0.26 and 0.01) and Nightly 76 (0.2 and 0)
2020-04-11 02:51:17 +00:00
8c7149c6a5 2421: Ion/JIT trusted principals, closes #914 2020-04-09 06:07:13 +00:00
d2da48c215 revert top sites, see #922 2020-04-08 08:01:07 +00:00
7e71b6663c 75-alpha, add 105e, closes #922 2020-04-08 07:12:14 +00:00
94c83519f2 74 final 2020-04-08 07:08:36 +00:00
e7d20867cb 2623 delegation 2421 ion/jit tweak 2020-04-06 00:39:52 +00:00
55ae994972 2421 fixup Ion/Jit note 2020-03-28 13:18:34 +00:00
f0945743b7 2662: clarify 4503 needed, #912 2020-03-27 16:20:41 +00:00
ee35d7c70d 2421: ion/jit and extensions note 2020-03-27 12:44:06 +00:00
fe1b03bd2a tls downgrades -> session only 2020-03-27 12:36:16 +00:00
187692af66 enforce disabled system + prefixed colors 2020-03-19 11:36:03 +00:00
b6e2a3f64f one of the 2012 webgl prefs deprecated 2020-03-12 14:44:14 +00:00
6f7e09ad43 1704 deprecated, add 1703 2020-03-12 05:23:57 +00:00
4ddf60cf32 0203: make sure users know these are 74+ prefs 2020-03-12 03:56:13 +00:00
24777c9ac2 FF74: 0203 updates (#904) 2020-03-12 03:44:52 +00:00
615ebeda2f start 74-alpha 2020-03-12 03:43:31 +00:00
16 changed files with 513 additions and 523 deletions

View File

@ -8,16 +8,15 @@ assignees: ''
--- ---
Before you proceed... Before you proceed...
- Issues will be closed as invalid if you do not [troubleshoot](https://github.com/ghacksuserjs/ghacks-user.js/wiki/1.4-Troubleshooting), including - Issues will be closed as invalid if you do not [troubleshoot](https://github.com/arkenfox/user.js/wiki/1.4-Troubleshooting), including
- confirming the problem is caused by the `user.js` - confirming the problem is caused by the `user.js`
- searching the `[Setup` tags in the `user.js` - searching the `[Setup` tags in the `user.js`
- Search the GitHub repository. The information you need is most likely here already. - Search the GitHub repository. The information you need is most likely here already.
- Note: We do not support forks - Note: We do not support forks
See also: See also:
- Extension breakage due to prefs [issue 391](https://github.com/ghacksuserjs/ghacks-user.js/issues/391) - Extension breakage due to prefs [issue 391](https://github.com/arkenfox/user.js/issues/391)
- Prefs vs Recommended Extensions: Co-Existance+Enhancement | Conflicts [issue 350](https://github.com/ghacksuserjs/ghacks-user.js/issues/350) - Prefs vs Recommended Extensions: Co-Existance+Enhancement | Conflicts [issue 350](https://github.com/arkenfox/user.js/issues/350)
- The extension CSP header modification game [issue 664](https://github.com/ghacksuserjs/ghacks-user.js/issues/664)
If you still need help, help us help you by providing relevant information: If you still need help, help us help you by providing relevant information:
- browser version - browser version

View File

@ -9,7 +9,7 @@ assignees: ''
We value feedback in general, but we value feedback from informed users more. There is no need for you to be an expert to participate (most of us aren't), but we hope that you at least understand our decisions before questioning them. We discuss all changes openly, and we do not make changes lightly. So, if you don't understand why we decided to add/remove/change a certain pref, search the repo. The answer is most certainly here. We value feedback in general, but we value feedback from informed users more. There is no need for you to be an expert to participate (most of us aren't), but we hope that you at least understand our decisions before questioning them. We discuss all changes openly, and we do not make changes lightly. So, if you don't understand why we decided to add/remove/change a certain pref, search the repo. The answer is most certainly here.
If some change we made took you by surprise (in the wrong way), remember that keeping track of changes is your responsibility. Watch the repo, read the [changelogs](https://github.com/ghacksuserjs/ghacks-user.js/issues?utf8=✓&q=is%3Aissue+label%3Achangelog), compare [releases](https://github.com/ghacksuserjs/ghacks-user.js/releases) as you update your copy of user.js, or use any other method you prefer. If some change we made took you by surprise (in the wrong way), remember that keeping track of changes is your responsibility. Watch the repo, read the [changelogs](https://github.com/arkenfox/user.js/issues?utf8=✓&q=is%3Aissue+label%3Achangelog), compare [releases](https://github.com/arkenfox/user.js/releases) as you update your copy of user.js, or use any other method you prefer.
Clear all of this when you're ready to type. Clear all of this when you're ready to type.

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2017 ghacksuserjs Copyright (c) 2020 arkenfox
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,27 +1,27 @@
### ![][b] user.js ### 🟪 user.js
A `user.js` is a configuration file that can control hundreds of Firefox settings. For a more technical breakdown and explanation, you can read more on the [overview](https://github.com/ghacksuserjs/ghacks-user.js/wiki/1.1-Overview) wiki page. A `user.js` is a configuration file that can control hundreds of Firefox settings. For a more technical breakdown and explanation, you can read more on the [overview](https://github.com/arkenfox/user.js/wiki/1.1-Overview) wiki page.
### ![][b] ghacks user.js ### 🟩 the arkenfox user.js
The `ghacks user.js` is a **template** which aims to provide as much privacy and enhanced security as possible, and to reduce tracking and fingerprinting as much as possible - while minimizing any loss of functionality and breakage (but it will happen).
Everyone, experts included, should at least read the [implementation](https://github.com/ghacksuserjs/ghacks-user.js/wiki/1.3-Implementation) wiki page, as it contains important information regarding a few `ghacks user.js` settings. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
The `arkenfox user.js` is a **template** which aims to provide as much privacy and enhanced security as possible, and to reduce tracking and fingerprinting as much as possible - while minimizing any loss of functionality and breakage (but it will happen).
Everyone, experts included, should at least read the [implementation](https://github.com/arkenfox/user.js/wiki/1.3-Implementation) wiki page, as it contains important information regarding a few `user.js` settings.
Note that we do *not* recommend connecting over Tor on Firefox. Use the [Tor Browser](https://www.torproject.org/projects/torbrowser.html.en) if your [threat model](https://www.torproject.org/about/torusers.html.en) calls for it, or for accessing hidden services. Note that we do *not* recommend connecting over Tor on Firefox. Use the [Tor Browser](https://www.torproject.org/projects/torbrowser.html.en) if your [threat model](https://www.torproject.org/about/torusers.html.en) calls for it, or for accessing hidden services.
Also be aware that this `user.js` is made specifically for desktop Firefox. Using it as-is in other Gecko-based browsers can be counterproductive, especially in the Tor Browser. Also be aware that the `arkenfox user.js` is made specifically for desktop Firefox. Using it as-is in other Gecko-based browsers can be counterproductive, especially in the Tor Browser.
Sitemap: [Releases](https://github.com/ghacksuserjs/ghacks-user.js/releases), [changelogs](https://github.com/ghacksuserjs/ghacks-user.js/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3Achangelog), [Wiki](https://github.com/ghacksuserjs/ghacks-user.js/wiki), [stickies](https://github.com/ghacksuserjs/ghacks-user.js/issues?q=is%3Aissue+is%3Aopen+label%3A%22sticky+topic%22). [diffs](https://github.com/ghacksuserjs/ghacks-user.js/issues?q=is%3Aissue+label%3Adiffs) ### 🟧 sitemap
### ![][b] acknowledgments - [Releases](https://github.com/arkenfox/user.js/releases)
Literally thousands of sources, references and suggestions. That said... - [changelogs](https://github.com/arkenfox/user.js/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3Achangelog)
- [Wiki](https://github.com/arkenfox/user.js/wiki)
- [stickies](https://github.com/arkenfox/user.js/issues?q=is%3Aissue+is%3Aopen+label%3A%22sticky+topic%22)
- [diffs](https://github.com/arkenfox/user.js/issues?q=is%3Aissue+label%3Adiffs)
* Martin Brinkmann at [ghacks](https://www.ghacks.net/) <sup>1</sup> ### 🟥 acknowledgments
* The ghacks community and commentators Literally thousands of sources, references and suggestions. Many thanks, and much appreciated.
* [12bytes](https://12bytes.org/articles/tech/firefox/firefoxgecko-configuration-guide-for-privacy-and-performance-buffs)
* The 12bytes article now uses this user.js and supplements it with an additional JS hosted at [Codeberg](https://codeberg.org/12bytes.org/Firefox-user.js-supplement)
<sup>1</sup> The ghacks user.js was an independent project by [Thorin-Oakenpants](https://github.com/Thorin-Oakenpants) started in early 2015 and was [first published](https://www.ghacks.net/2015/08/18/a-comprehensive-list-of-firefox-privacy-and-security-settings/) at ghacks in August 2015. With Martin Brinkmann's blessing, it will keep the ghacks name.
### ![][b] [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[b]: /wikipiki/bullet01.png

View File

@ -1,3 +1,3 @@
theme: jekyll-theme-midnight theme: jekyll-theme-midnight
title: ghacks-user.js title: user.js
description: An ongoing comprehensive user.js template for configuring and hardening Firefox privacy, security and anti-fingerprinting description: An ongoing comprehensive user.js template for configuring and hardening Firefox privacy, security and anti-fingerprinting

View File

@ -3,7 +3,7 @@ TITLE prefs.js cleaner
REM ### prefs.js cleaner for Windows REM ### prefs.js cleaner for Windows
REM ## author: @claustromaniac REM ## author: @claustromaniac
REM ## version: 2.2 REM ## version: 2.3
CD /D "%~dp0" CD /D "%~dp0"
@ -13,7 +13,7 @@ ECHO:
ECHO ######################################## ECHO ########################################
ECHO #### prefs.js cleaner for Windows #### ECHO #### prefs.js cleaner for Windows ####
ECHO #### by claustromaniac #### ECHO #### by claustromaniac ####
ECHO #### v2.2 #### ECHO #### v2.3 ####
ECHO ######################################## ECHO ########################################
ECHO: ECHO:
CALL :message "This script should be run from your Firefox profile directory." CALL :message "This script should be run from your Firefox profile directory."
@ -101,7 +101,7 @@ ECHO add-ons disabled. Then, restart it again normally, and see if the
CALL :message " problems were solved." CALL :message " problems were solved."
ECHO: ECHO:
CALL :message "If you are able to identify the cause of your issues, please bring it up" CALL :message "If you are able to identify the cause of your issues, please bring it up"
ECHO on ghacks-user.js GitHub repository. ECHO on arkenfox user.js GitHub repository.
ECHO: ECHO:
ECHO: ECHO:
PAUSE PAUSE

View File

@ -2,7 +2,7 @@
## prefs.js cleaner for Linux/Mac ## prefs.js cleaner for Linux/Mac
## author: @claustromaniac ## author: @claustromaniac
## version: 1.2 ## version: 1.3
## special thanks to @overdodactyl and @earthlng for a few snippets that I stol..*cough* borrowed from the updater.sh ## special thanks to @overdodactyl and @earthlng for a few snippets that I stol..*cough* borrowed from the updater.sh
@ -58,7 +58,7 @@ echo -e "\n\n"
echo " ╔══════════════════════════╗" echo " ╔══════════════════════════╗"
echo " ║ prefs.js cleaner ║" echo " ║ prefs.js cleaner ║"
echo " ║ by claustromaniac ║" echo " ║ by claustromaniac ║"
echo " ║ v1.2 ║" echo " ║ v1.3 ║"
echo " ╚══════════════════════════╝" echo " ╚══════════════════════════╝"
echo -e "\nThis script should be run from your Firefox profile directory.\n" echo -e "\nThis script should be run from your Firefox profile directory.\n"
echo "It will remove any entries from prefs.js that also exist in user.js." echo "It will remove any entries from prefs.js that also exist in user.js."
@ -90,7 +90,7 @@ select option in Start Help Exit; do
echo "4. Rename or copy your latest backup to prefs.js." echo "4. Rename or copy your latest backup to prefs.js."
echo "5. Run Firefox and see if you notice anything wrong with it." echo "5. Run Firefox and see if you notice anything wrong with it."
echo "6. If you do notice something wrong, especially with your extensions, and/or with the UI, go to about:support, and restart Firefox with add-ons disabled. Then, restart it again normally, and see if the problems were solved." echo "6. If you do notice something wrong, especially with your extensions, and/or with the UI, go to about:support, and restart Firefox with add-ons disabled. Then, restart it again normally, and see if the problems were solved."
echo -e "If you are able to identify the cause of your issues, please bring it up on ghacks-user.js GitHub repository.\n" echo -e "If you are able to identify the cause of your issues, please bring it up on the arkenfox user.js GitHub repository.\n"
;; ;;
Exit) Exit)
fQuit 0 fQuit 0

View File

@ -1,10 +1,12 @@
/*** /***
This will reset the preferences that are under sections 4600 & 4700 in the ghacks user.js Version: up to and including FF/ESR78
up to and including Firefox/ESR 68. These are the prefs that are no longer necessary,
or they conflict with, privacy.resistFingerprinting if you have that enabled. This will reset the preferences that are under sections 4600 & 4700 in the
arkenfox user.js. These are the prefs that are no longer necessary, or they
conflict with, privacy.resistFingerprinting if you have that enabled.
For instructions see: For instructions see:
https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts] https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts]
***/ ***/
(function() { (function() {
@ -24,6 +26,8 @@
'webgl.enable-debug-renderer-info', 'webgl.enable-debug-renderer-info',
'dom.w3c_pointer_events.enabled', 'dom.w3c_pointer_events.enabled',
'ui.use_standins_for_native_colors', 'ui.use_standins_for_native_colors',
'ui.systemUsesDarkTheme',
'ui.prefersReducedMotion',
/* section 4700 */ /* section 4700 */
'general.useragent.override', 'general.useragent.override',
'general.buildID.override', 'general.buildID.override',

View File

@ -1,17 +1,44 @@
/*** /***
Version: up to and including FF/ESR78
This will reset the preferences that have been deprecated by Mozilla This will reset the preferences that have been deprecated by Mozilla
and used in the ghacks user.js up to and including Firefox/ESR 68 and used in the arkenfox user.js
It is in reverse order, so feel free to remove sections that do not apply It is in reverse order, so feel free to remove sections that do not apply
For instructions see: For instructions see:
https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts] https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts]
***/ ***/
(function() { (function() {
let ops = [ let ops = [
/* deprecated */ /* deprecated */
/* 78 */
'media.autoplay.enabled.user-gestures-needed',
'toolkit.cosmeticAnimations.enabled',
/* 77 */
'browser.urlbar.oneOffSearches',
'browser.tabs.remote.allowLinkedWebInFileUriProcess',
/* 76 */
'extensions.blocklist.url',
/* 74 */
'geo.wifi.uri',
'geo.wifi.logging.enabled',
'privacy.userContext.longPressBehavior',
'webgl.disable-extensions',
/* 72 */
'browser.newtabpage.activity-stream.telemetry.ping.endpoint',
'toolkit.telemetry.hybridContent.enabled',
'dom.indexedDB.enabled',
/* 71 */
'devtools.webide.enabled',
'devtools.webide.autoinstallADBExtension',
'offline-apps.allow_by_default',
/* 69 */
'gfx.downloadable_fonts.woff2.enabled',
'plugins.click_to_play',
'media.autoplay.allow-muted',
/* 68 */ /* 68 */
'browser.newtabpage.activity-stream.disableSnippets', 'browser.newtabpage.activity-stream.disableSnippets',
'browser.aboutHomeSnippets.updateUrl', 'browser.aboutHomeSnippets.updateUrl',

View File

@ -1,15 +1,15 @@
/*** /***
This will reset the preferences that have been removed completely from the ghacks user.js. This will reset the preferences that have been removed completely from the arkenfox user.js.
Last updated: 19-December-2019 Last updated: 02-Nov-2020
For instructions see: For instructions see:
https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts] https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts]
***/ ***/
(function() { (function() {
let ops = [ let ops = [
/* removed in ghacks user.js v52-57 */ /* removed in arkenfox user.js v52-57 */
/* 52-alpha */ /* 52-alpha */
'browser.search.reset.enabled', 'browser.search.reset.enabled',
'browser.search.reset.whitelist', 'browser.search.reset.whitelist',
@ -218,6 +218,17 @@
/* 71-beta */ /* 71-beta */
'media.block-autoplay-until-in-foreground', 'media.block-autoplay-until-in-foreground',
'middlemouse.paste', 'middlemouse.paste',
/* 75-beta */
'browser.search.geoip.url',
'browser.search.region',
/* 79-beta */
'browser.urlbar.usepreloadedtopurls.enabled',
/* 82-beta */
'dom.IntersectionObserver.enabled',
'extensions.screenshots.upload-disabled',
'privacy.partition.network_state',
'security.ssl3.dhe_rsa_aes_128_sha',
'security.ssl3.dhe_rsa_aes_256_sha',
/* reset parrot: check your open about:config after running the script */ /* reset parrot: check your open about:config after running the script */
'_user.js.parrot' '_user.js.parrot'
] ]

View File

@ -1,5 +1,5 @@
/*** ghacks-user.js troubleshooter.js v1.6.0 ***/ /*** arkenfox user.js troubleshooter.js v1.6.2 ***/
(function() { (function() {
@ -62,6 +62,7 @@
'dom.webaudio.enabled', 'dom.webaudio.enabled',
'media.autoplay.enabled', 'media.autoplay.enabled',
'media.autoplay.default', // FF63+ 'media.autoplay.default', // FF63+
'media.autoplay.blocking_policy', // FF78+
/* Forms */ /* Forms */
'browser.formfill.enable', 'browser.formfill.enable',
@ -107,7 +108,7 @@
] ]
// any runtime-set pref that everyone will have and that can be safely reset // any runtime-set pref that everyone will have and that can be safely reset
const oFILLER = { type: 64, name: 'extensions.blocklist.pingCountTotal', value: -1 }; const oFILLER = { type: 64, name: 'app.update.lastUpdateTime.browser-cleanup-thumbnails', value: 1580000000 };
function getMyList(arr) { function getMyList(arr) {
const aRet = []; const aRet = [];

View File

@ -1,12 +1,12 @@
@ECHO OFF & SETLOCAL EnableDelayedExpansion @ECHO OFF & SETLOCAL EnableDelayedExpansion
TITLE ghacks user.js updater TITLE arkenfox user.js updater
REM ## ghacks-user.js updater for Windows REM ## arkenfox user.js updater for Windows
REM ## author: @claustromaniac REM ## author: @claustromaniac
REM ## version: 4.10 REM ## version: 4.12
REM ## instructions: https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.3-Updater-Scripts REM ## instructions: https://github.com/arkenfox/user.js/wiki/3.3-Updater-Scripts
SET v=4.10 SET v=4.12
VERIFY ON VERIFY ON
CD /D "%~dp0" CD /D "%~dp0"
@ -52,7 +52,7 @@ IF DEFINED _updateb (
REM Uncomment the next line and comment out the PowerShell call for testing. REM Uncomment the next line and comment out the PowerShell call for testing.
REM COPY /B /Y "!_myname!.bat" "[updated]!_myname!.bat" >nul REM COPY /B /Y "!_myname!.bat" "[updated]!_myname!.bat" >nul
( (
PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/updater.bat', '[updated]!_myname!.bat')" PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/arkenfox/user.js/master/updater.bat', '[updated]!_myname!.bat')"
) >nul 2>&1 ) >nul 2>&1
IF EXIST "[updated]!_myname!.bat" ( IF EXIST "[updated]!_myname!.bat" (
START /min CMD /C "[updated]!_myname!.bat" !_myparams! START /min CMD /C "[updated]!_myname!.bat" !_myparams!
@ -100,7 +100,10 @@ IF NOT EXIST user.js (
) )
:exitloop :exitloop
IF NOT "!_name!"=="" ( IF NOT "!_name!"=="" (
IF /I NOT "!_name!"=="!_name:ghacks=!" ( SET "_tempvar="
IF /I NOT "!_name!"=="!_name:ghacks=!" SET _tempvar=1
IF /I NOT "!_name!"=="!_name:arkenfox=!" SET _tempvar=1
IF !_tempvar! EQU 1 (
CALL :message "!_name! !_version:~2!,!_date!" CALL :message "!_name! !_version:~2!,!_date!"
) ELSE (CALL :message "Current user.js version not recognised.") ) ELSE (CALL :message "Current user.js version not recognised.")
) ELSE (CALL :message "Current user.js version not recognised.") ) ELSE (CALL :message "Current user.js version not recognised.")
@ -108,7 +111,7 @@ IF NOT EXIST user.js (
ECHO: ECHO:
IF NOT DEFINED _ua ( IF NOT DEFINED _ua (
CALL :message "This batch should be run from your Firefox profile directory." CALL :message "This batch should be run from your Firefox profile directory."
ECHO: It will download the latest version of ghacks user.js from github and then ECHO: It will download the latest version of arkenfox user.js from github and then
CALL :message "append any of your own changes from user-overrides.js to it." CALL :message "append any of your own changes from user-overrides.js to it."
CALL :message "Visit the wiki for more detailed information." CALL :message "Visit the wiki for more detailed information."
ECHO: ECHO:
@ -130,16 +133,16 @@ IF DEFINED _log (
IF EXIST user.js.new (DEL /F "user.js.new") IF EXIST user.js.new (DEL /F "user.js.new")
CALL :message "Retrieving latest user.js file from github repository..." CALL :message "Retrieving latest user.js file from github repository..."
( (
PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js', 'user.js.new')" PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/arkenfox/user.js/master/user.js', 'user.js.new')"
) >nul 2>&1 ) >nul 2>&1
IF EXIST user.js.new ( IF EXIST user.js.new (
IF DEFINED _rfpalts ( IF DEFINED _rfpalts (
CALL :message "Activating RFP Alternatives section..." CALL :message "Activating RFP Alternatives section..."
CALL :activate user.js.new "[SETUP-non-RFP]" CALL :activate user.js.new "[SETUP-non-RFP]"
) )
IF DEFINED _esr ( IF DEFINED _esr (
CALL :message "Activating ESR section..." CALL :message "Activating ESR section..."
CALL :activate user.js.new ".x still uses all the following prefs" CALL :activate user.js.new ".x still uses all the following prefs"
) )
IF DEFINED _multi ( IF DEFINED _multi (
FORFILES /P user.js-overrides /M *.js >nul 2>&1 FORFILES /P user.js-overrides /M *.js >nul 2>&1
@ -216,8 +219,8 @@ ENDLOCAL
GOTO :EOF GOTO :EOF
::::::::::::::: Activate Section ::::::::::::::: ::::::::::::::: Activate Section :::::::::::::::
:activate :activate
:: arg1 = file :: arg1 = file
:: arg2 = line substring :: arg2 = line substring
SETLOCAL DisableDelayedExpansion SETLOCAL DisableDelayedExpansion
( (

View File

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
## ghacks-user.js updater for macOS and Linux ## arkenfox user.js updater for macOS and Linux
## version: 2.5 ## version: 2.8
## Author: Pat Johnson (@overdodactyl) ## Author: Pat Johnson (@overdodactyl)
## Additional contributors: @earthlng, @ema-pe, @claustromaniac ## Additional contributors: @earthlng, @ema-pe, @claustromaniac
@ -11,7 +11,7 @@
readonly CURRDIR=$(pwd) readonly CURRDIR=$(pwd)
sfp=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null) sfp=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null)
if [ -z "$sfp" ]; then sfp=${BASH_SOURCE[0]}; fi [ -z "$sfp" ] && sfp=${BASH_SOURCE[0]}
readonly SCRIPT_DIR=$(dirname "${sfp}") readonly SCRIPT_DIR=$(dirname "${sfp}")
@ -42,27 +42,27 @@ ESR=false
# Download method priority: curl -> wget # Download method priority: curl -> wget
DOWNLOAD_METHOD='' DOWNLOAD_METHOD=''
if [[ $(command -v 'curl') ]]; then if [[ $(command -v 'curl') ]]; then
DOWNLOAD_METHOD='curl' DOWNLOAD_METHOD='curl --max-redirs 3 -so'
elif [[ $(command -v 'wget') ]]; then elif [[ $(command -v 'wget') ]]; then
DOWNLOAD_METHOD='wget' DOWNLOAD_METHOD='wget --max-redirect 3 --quiet -O'
else else
echo -e "${RED}This script requires curl or wget.\nProcess aborted${NC}" echo -e "${RED}This script requires curl or wget.\nProcess aborted${NC}"
exit 0 exit 1
fi fi
show_banner () { show_banner () {
echo -e "${BBLUE}\n" echo -e "${BBLUE}
echo ' ############################################################################' ############################################################################
echo ' #### ####' #### ####
echo ' #### ghacks user.js ####' #### arkenfox user.js ####
echo ' #### Hardening the Privacy and Security Settings of Firefox ####' #### Hardening the Privacy and Security Settings of Firefox ####
echo ' #### Maintained by @Thorin-Oakenpants and @earthlng ####' #### Maintained by @Thorin-Oakenpants and @earthlng ####
echo ' #### Updater for macOS and Linux by @overdodactyl ####' #### Updater for macOS and Linux by @overdodactyl ####
echo ' #### ####' #### ####
echo ' ############################################################################' ############################################################################"
echo -e "${NC}\n" echo -e "${NC}\n"
echo -e "Documentation for this script is available here: ${CYAN}https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.3-Updater-Scripts${NC}\n" echo -e "Documentation for this script is available here: ${CYAN}https://github.com/arkenfox/user.js/wiki/3.3-Updater-Scripts${NC}\n"
} }
######################### #########################
@ -70,66 +70,50 @@ show_banner () {
######################### #########################
usage() { usage() {
echo -e "${BLUE}\nUsage: $0 [-h] [-p PROFILE] [-u] [-d] [-s] [-n] [-b] [-c] [-v] [-r] [-e] [-o OVERRIDE]\n${NC}" 1>&2 # Echo usage string to standard error echo
echo 'Optional Arguments:' echo -e "${BLUE}Usage: $0 [-bcdehlnrsuv] [-p PROFILE] [-o OVERRIDE]${NC}" 1>&2 # Echo usage string to standard error
echo -e "\t-h,\t\t Show this help message and exit." echo -e "
echo -e "\t-p PROFILE,\t Path to your Firefox profile (if different than the dir of this script)" Optional Arguments:
echo -e "\t\t\t IMPORTANT: if the path include spaces, wrap the entire argument in quotes." -h Show this help message and exit.
echo -e "\t-l, \t\t Choose your Firefox profile from a list" -p PROFILE Path to your Firefox profile (if different than the dir of this script)
echo -e "\t-u,\t\t Update updater.sh and execute silently. Do not seek confirmation." IMPORTANT: If the path contains spaces, wrap the entire argument in quotes.
echo -e "\t-d,\t\t Do not look for updates to updater.sh." -l Choose your Firefox profile from a list
echo -e "\t-s,\t\t Silently update user.js. Do not seek confirmation." -u Update updater.sh and execute silently. Do not seek confirmation.
echo -e "\t-b,\t\t Only keep one backup of each file." -d Do not look for updates to updater.sh.
echo -e "\t-c,\t\t Create a diff file comparing old and new user.js within userjs_diffs. " -s Silently update user.js. Do not seek confirmation.
echo -e "\t-o OVERRIDE,\t Filename or path to overrides file (if different than user-overrides.js)." -b Only keep one backup of each file.
echo -e "\t\t\t If used with -p, paths should be relative to PROFILE or absolute paths" -c Create a diff file comparing old and new user.js within userjs_diffs.
echo -e "\t\t\t If given a directory, all files inside will be appended recursively." -o OVERRIDE Filename or path to overrides file (if different than user-overrides.js).
echo -e "\t\t\t You can pass multiple files or directories by passing a comma separated list." If used with -p, paths should be relative to PROFILE or absolute paths
echo -e "\t\t\t\t Note: If a directory is given, only files inside ending in the extension .js are appended" If given a directory, all files inside will be appended recursively.
echo -e "\t\t\t\t IMPORTANT: do not add spaces between files/paths. Ex: -o file1.js,file2.js,dir1" You can pass multiple files or directories by passing a comma separated list.
echo -e "\t\t\t\t IMPORTANT: if any files/paths include spaces, wrap the entire argument in quotes." Note: If a directory is given, only files inside ending in the extension .js are appended
echo -e "\t\t\t\t\t Ex: -o \"override folder\" " IMPORTANT: Do not add spaces between files/paths. Ex: -o file1.js,file2.js,dir1
echo -e "\t-n,\t\t Do not append any overrides, even if user-overrides.js exists." IMPORTANT: If any file/path contains spaces, wrap the entire argument in quotes.
echo -e "\t-v,\t\t Open the resulting user.js file." Ex: -o \"override folder\"
echo -e "\t-r,\t\t Only download user.js to a temporary file and open it." -n Do not append any overrides, even if user-overrides.js exists.
echo -e "\t-e,\t\t Activate ESR related preferences." -v Open the resulting user.js file.
echo -e -r Only download user.js to a temporary file and open it.
echo 'Deprecated Arguments (they still work for now):' -e Activate ESR related preferences."
echo -e "\t-donotupdate,\t Use instead -d" echo
echo -e "\t-update,\t Use instead -u"
echo -e
exit 1 exit 1
} }
legacy_argument () {
echo -e "${ORANGE}\nWarning: command line arguments have changed."
echo -e "$1 has been deprecated and may not work in the future.\n"
echo -e "Please view the new options using the -h argument.${NC}"
}
######################### #########################
# File Handling # # File Handling #
######################### #########################
# Download files # Download files
download_file () { download_file () { # expects URL as argument ($1)
declare -r url=$1
declare -r tf=$(mktemp) declare -r tf=$(mktemp)
local dlcmd=''
if [ $DOWNLOAD_METHOD = 'curl' ]; then $DOWNLOAD_METHOD "${tf}" "$1" && echo "$tf" || echo '' # return the temp-filename or empty string on error
dlcmd="curl -o $tf"
else
dlcmd="wget -O $tf"
fi
$dlcmd "${url}" &>/dev/null && echo "$tf" || echo '' # return the temp-filename (or empty string on error)
} }
open_file () { #expects one argument: file_path open_file () { # expects one argument: file_path
if [ "$(uname)" == 'Darwin' ]; then if [ "$(uname)" == 'Darwin' ]; then
open "$1" open "$1"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then elif [ "$(uname -s | cut -c -5)" == "Linux" ]; then
xdg-open "$1" xdg-open "$1"
else else
echo -e "${RED}Error: Sorry, opening files is not supported for your OS.${NC}" echo -e "${RED}Error: Sorry, opening files is not supported for your OS.${NC}"
@ -204,23 +188,22 @@ get_updater_version () {
# Update updater.sh # Update updater.sh
# Default: Check for update, if available, ask user if they want to execute it # Default: Check for update, if available, ask user if they want to execute it
# Args: # Args:
# -donotupdate: New version will not be looked for and update will not occur # -d: New version will not be looked for and update will not occur
# -update: Check for update, if available, execute without asking # -u: Check for update, if available, execute without asking
update_updater () { update_updater () {
if [ $UPDATE = 'no' ]; then if [ $UPDATE = 'no' ]; then
return 0 # User signified not to check for updates return 0 # User signified not to check for updates
fi fi
declare -r tmpfile=$(download_file 'https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/updater.sh') declare -r tmpfile="$(download_file 'https://raw.githubusercontent.com/arkenfox/user.js/master/updater.sh')"
[ -z "${tmpfile}" ] && echo -e "${RED}Error! Could not download updater.sh${NC}" && return 1 # check if download failed
if [[ $(get_updater_version "${SCRIPT_DIR}/updater.sh") < $(get_updater_version "${tmpfile}") ]]; then if [[ $(get_updater_version "${SCRIPT_DIR}/updater.sh") < $(get_updater_version "${tmpfile}") ]]; then
if [ $UPDATE = 'check' ]; then if [ $UPDATE = 'check' ]; then
echo -e "There is a newer version of updater.sh available. ${RED}Update and execute Y/N?${NC}" echo -e "There is a newer version of updater.sh available. ${RED}Update and execute Y/N?${NC}"
read -p "" -n 1 -r read -p "" -n 1 -r
echo -e "\n\n" echo -e "\n\n"
if [[ $REPLY =~ ^[Nn]$ ]]; then [[ $REPLY =~ ^[Nn]$ ]] && return 0 # Update available, but user chooses not to update
return 0 # Update available, but user chooses not to update
fi
fi fi
else else
return 0 # No update available return 0 # No update available
@ -228,7 +211,7 @@ update_updater () {
mv "${tmpfile}" "${SCRIPT_DIR}/updater.sh" mv "${tmpfile}" "${SCRIPT_DIR}/updater.sh"
chmod u+x "${SCRIPT_DIR}/updater.sh" chmod u+x "${SCRIPT_DIR}/updater.sh"
"${SCRIPT_DIR}/updater.sh" "$@" -d "${SCRIPT_DIR}/updater.sh" "$@" -d
exit 1 exit 0
} }
@ -238,11 +221,7 @@ update_updater () {
# Returns version number of a user.js file # Returns version number of a user.js file
get_userjs_version () { get_userjs_version () {
if [ -e $1 ]; then [ -e $1 ] && echo "$(sed -n '4p' "$1")" || echo "Not detected."
echo "$(sed -n '4p' "$1")"
else
echo "Not detected."
fi
} }
add_override () { add_override () {
@ -252,7 +231,7 @@ add_override () {
cat "$input" >> user.js cat "$input" >> user.js
echo -e "Status: ${GREEN}Override file appended:${NC} ${input}" echo -e "Status: ${GREEN}Override file appended:${NC} ${input}"
elif [ -d "$input" ]; then elif [ -d "$input" ]; then
FSAVEIFS=$IFS SAVEIFS=$IFS
IFS=$'\n\b' # Set IFS IFS=$'\n\b' # Set IFS
FILES="${input}"/*.js FILES="${input}"/*.js
for f in $FILES for f in $FILES
@ -271,12 +250,13 @@ remove_comments () { # expects 2 arguments: from-file and to-file
# Applies latest version of user.js and any custom overrides # Applies latest version of user.js and any custom overrides
update_userjs () { update_userjs () {
declare -r newfile=$(download_file 'https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js') declare -r newfile="$(download_file 'https://raw.githubusercontent.com/arkenfox/user.js/master/user.js')"
[ -z "${newfile}" ] && echo -e "${RED}Error! Could not download user.js${NC}" && return 1 # check if download failed
echo 'Please observe the following information:' echo -e "Please observe the following information:
echo -e "\tFirefox profile: ${ORANGE}$(pwd)${NC}" Firefox profile: ${ORANGE}$(pwd)${NC}
echo -e "\tAvailable online: ${ORANGE}$(get_userjs_version $newfile)${NC}" Available online: ${ORANGE}$(get_userjs_version $newfile)${NC}
echo -e "\tCurrently using: ${ORANGE}$(get_userjs_version user.js)\n${NC}\n" Currently using: ${ORANGE}$(get_userjs_version user.js)${NC}\n\n"
if [ $CONFIRM = 'yes' ]; then if [ $CONFIRM = 'yes' ]; then
echo -e "This script will update to the latest user.js file and append any custom configurations from user-overrides.js. ${RED}Continue Y/N? ${NC}" echo -e "This script will update to the latest user.js file and append any custom configurations from user-overrides.js. ${RED}Continue Y/N? ${NC}"
@ -298,9 +278,7 @@ update_userjs () {
# backup user.js # backup user.js
mkdir -p userjs_backups mkdir -p userjs_backups
local bakname="userjs_backups/user.js.backup.$(date +"%Y-%m-%d_%H%M")" local bakname="userjs_backups/user.js.backup.$(date +"%Y-%m-%d_%H%M")"
if [ $BACKUP = 'single' ]; then [ $BACKUP = 'single' ] && bakname='userjs_backups/user.js.backup'
bakname='userjs_backups/user.js.backup'
fi
cp user.js "$bakname" &>/dev/null cp user.js "$bakname" &>/dev/null
mv "${newfile}" user.js mv "${newfile}" user.js
@ -313,8 +291,10 @@ update_userjs () {
# apply overrides # apply overrides
if [ "$SKIPOVERRIDE" = false ]; then if [ "$SKIPOVERRIDE" = false ]; then
while IFS=',' read -ra FILE; do while IFS=',' read -ra FILES; do
add_override "$FILE" for FILE in "${FILES[@]}"; do
add_override "$FILE"
done
done <<< "$OVERRIDE" done <<< "$OVERRIDE"
fi fi
@ -334,14 +314,12 @@ update_userjs () {
echo -e "Status: ${GREEN}A diff file was created:${NC} ${PWD}/${diffname}" echo -e "Status: ${GREEN}A diff file was created:${NC} ${PWD}/${diffname}"
else else
echo -e "Warning: ${ORANGE}Your new user.js file appears to be identical. No diff file was created.${NC}" echo -e "Warning: ${ORANGE}Your new user.js file appears to be identical. No diff file was created.${NC}"
if [ $BACKUP = 'multiple' ]; then [ $BACKUP = 'multiple' ] && rm $bakname &>/dev/null
rm $bakname &>/dev/null
fi
fi fi
rm $past_nocomments $current_nocomments $pastuserjs &>/dev/null rm $past_nocomments $current_nocomments $pastuserjs &>/dev/null
fi fi
if [ "$VIEW" = true ]; then open_file "${PWD}/user.js"; fi [ "$VIEW" = true ] && open_file "${PWD}/user.js"
} }
######################### #########################
@ -349,16 +327,9 @@ update_userjs () {
######################### #########################
if [ $# != 0 ]; then if [ $# != 0 ]; then
readonly legacy_lc=$(echo $1 | tr '[A-Z]' '[a-z]')
# Display usage if first argument is -help or --help # Display usage if first argument is -help or --help
if [ $1 = '--help' ] || [ $1 = '-help' ]; then if [ $1 = '--help' ] || [ $1 = '-help' ]; then
usage usage
elif [ $legacy_lc = '-donotupdate' ]; then
UPDATE='no'
legacy_argument $1
elif [ $legacy_lc = '-update' ]; then
UPDATE='yes'
legacy_argument $1
else else
while getopts ":hp:ludsno:bcvre" opt; do while getopts ":hp:ludsno:bcvre" opt; do
case $opt in case $opt in
@ -399,11 +370,12 @@ if [ $# != 0 ]; then
ESR=true ESR=true
;; ;;
r) r)
tfile=$(download_file 'https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js') tfile="$(download_file 'https://raw.githubusercontent.com/arkenfox/user.js/master/user.js')"
[ -z "${tfile}" ] && echo -e "${RED}Error! Could not download user.js${NC}" && exit 1 # check if download failed
mv $tfile "${tfile}.js" mv $tfile "${tfile}.js"
echo -e "${ORANGE}Warning: user.js was saved to temporary file ${tfile}.js${NC}" echo -e "${ORANGE}Warning: user.js was saved to temporary file ${tfile}.js${NC}"
open_file "${tfile}.js" open_file "${tfile}.js"
exit 1 exit 0
;; ;;
\?) \?)
echo -e "${RED}\n Error! Invalid option: -$OPTARG${NC}" >&2 echo -e "${RED}\n Error! Invalid option: -$OPTARG${NC}" >&2
@ -411,7 +383,7 @@ if [ $# != 0 ]; then
;; ;;
:) :)
echo -e "${RED}Error! Option -$OPTARG requires an argument.${NC}" >&2 echo -e "${RED}Error! Option -$OPTARG requires an argument.${NC}" >&2
exit 1 exit 2
;; ;;
esac esac
done done

707
user.js

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB