1
0
mirror of https://github.com/arkenfox/user.js.git synced 2026-06-16 01:12:52 +05:30

Compare commits

..

114 Commits

Author SHA1 Message Date
Thorin-Oakenpants fa78c53114 v85 2021-01-28 03:13:36 +00:00
Thorin-Oakenpants 2f6b14ab6e 1201: add error code, fixes #1094 2021-01-26 19:58:57 +00:00
Thorin-Oakenpants 2dd455ef83 network.http.redirection-limit, fixes #1100 2021-01-26 19:39:33 +00:00
Thorin-Oakenpants 306610da8e remove 2614, see #1100 2021-01-26 19:37:54 +00:00
earthlng 59ac1727f7 v4.14 - check for TLS1.2 (#1097) 2021-01-22 12:15:12 +00:00
Thorin-Oakenpants c974b3252d move [STATS] from 1270 to 1201, #1094 2021-01-22 12:10:15 +00:00
Thorin-Oakenpants 480933484f 2624: windows.name default FF86+
https://bugzilla.mozilla.org/1685089
2021-01-21 11:17:16 +00:00
earthlng 0cbd8a13a3 Update updater.bat 2021-01-19 17:17:03 +00:00
earthlng ae6c76fe54 v4.13 - fix TLS issue with PowerShell 2021-01-19 17:07:39 +00:00
Thorin-Oakenpants 1f098f2eaf start 85-alpha, also fix #1090 2021-01-17 23:04:37 +00:00
earthlng 11977e7017 v2.4 - add strlen check for prefs.js
cmd.exe has a command line length limit of 8192 characters. Abort if prefs.js contains strings that would get dropped while recreating the new prefs.js.
2021-01-17 15:27:50 +00:00
Thorin-Oakenpants 27dd6aa62d 84 final 2021-01-05 13:13:52 +00:00
earthlng c570e4fdbd Update troubleshooter.js 2020-12-30 15:12:07 +00:00
earthlng da58f84fa6 Update troubleshooter.js 2020-12-30 15:06:49 +00:00
Thorin-Oakenpants 755a45505f snippets providers
`browser.newtabpage.activity-stream.asrouter.providers.snippets`

These (which landed in FF64 with snippets above) are not in the user.js, so why bother with the snippet one
- `browser.newtabpage.activity-stream.asrouter.providers.cfr`
- `browser.newtabpage.activity-stream.asrouter.providers.onboarding`

also these aren't in the user.js
- `browser.newtabpage.activity-stream.asrouter.providers.cfr-fxa`
- `browser.newtabpage.activity-stream.asrouter.providers.message-groups`
- `browser.newtabpage.activity-stream.asrouter.providers.messaging-experiments`
- `browser.newtabpage.activity-stream.asrouter.providers.whats-new-panel`

There are no privacy concerns here. At the end of the day, what Firefox connects to and sends is E2EE and only used locally in non-web content: and you have other prefs and a UI to disable them from being displayed
2020-12-30 10:25:26 +00:00
Thorin-Oakenpants 9d74cb9526 remove useless snippet pref 2020-12-30 10:17:35 +00:00
Thorin-Oakenpants 8c9d0bbe72 harden cross-domain referers, closes #1077 2020-12-27 05:01:33 +00:00
Thorin-Oakenpants 0152b38b8b add override recipes link to readme steps 2020-12-25 16:06:32 +00:00
Thorin-Oakenpants e6cf90146a add override recipes 2020-12-25 15:55:01 +00:00
earthlng 63d1258f2e updater.sh v2.9
rollout the latest changes
2020-12-25 14:03:40 +00:00
ray851107 46bab27f94 updater.sh: support custom script names (#1075)
thanks @ray851107
2020-12-25 14:02:35 +00:00
Thorin-Oakenpants 2cfbba1472 search-to-tab: FF85+ 2020-12-19 07:23:13 +00:00
earthlng c980bda695 Update troubleshooter.js
oops
2020-12-16 14:43:46 +00:00
earthlng feaa1c3e99 prefs update
`browser.storageManager.enabled` -- removed in FF61 (1428306)
`security.csp.experimentalEnabled` -- removed in FF68 (1386214)
`gfx.downloadable_fonts.woff2.enabled` -- removed in FF69 (1556991)
`plugin.sessionPermissionNow.intervalInMinutes` -- removed in FF70 (1581664)
`plugin.defaultXpi.state` -- removed in FF72 (1596090)
`geo.wifi.uri` -- renamed to `geo.provider.network.url` in FF74 (1613627)
`browser.tabs.remote.allowLinkedWebInFileUriProcess` -- removed in FF77 (1603007)
2020-12-16 14:40:42 +00:00
Thorin-Oakenpants aa1c2145bb layout.css.visited_links_enabled 2020-12-09 09:30:21 +00:00
Thorin-Oakenpants 335ee84540 remove layout.css.visited_links_enabled, #933
This no longer has any affect since FF77+: see https://bugzilla.mozilla.org/1632765
2020-12-09 09:26:50 +00:00
Thorin-Oakenpants 5c37d50f4e tidy
- remove useless `see` word for reference links
- fixup 0701
   - "do not play nice" is not measurable
   - don't reference to self as a source: people can just search "VPN leak Ipv6" or something
2020-12-07 19:34:14 +00:00
Thorin-Oakenpants 77abf35761 tidy
- shrink and remove outdated info from section 0300 header
- combine some bugzillas
- drop some references
   - 1647829 for HTTPS-Only mode
   - hardware metrics: not going to implicitly encourage users to use this pref or tell them what sizes to use
- update [STATS]
   - also remove TLS [STATS].. stats on TLS 1.0 and 1.1 are irrelevant: the default is now TLS 1.2+
- single CRLite reference for all blog articles
- save 588 bytes so all you bastards can theoretically load Firefox just that tiny bit faster
2020-12-06 21:09:07 +00:00
Thorin-Oakenpants fa85c9da5b fixup double word 2020-11-23 10:46:30 +00:00
Thorin-Oakenpants cf53982086 1244: CRLite, closes #1065 2020-11-22 18:15:25 +00:00
Thorin-Oakenpants 91cbc1e09a HTTPS-Only mode, closes #1047 2020-11-22 17:59:44 +00:00
Thorin-Oakenpants a7e4268d8b 2730 appCache, closes #1055 2020-11-22 17:25:33 +00:00
Thorin-Oakenpants 699eacf1fd add FPI scheme, closes #1066 (#1067) 2020-11-22 17:21:31 +00:00
Thorin-Oakenpants 0189438e46 start 84-alpha 2020-11-22 17:11:31 +00:00
Thorin-Oakenpants 94712f59a3 83 final 2020-11-22 17:05:34 +00:00
Thorin-Oakenpants ef93a754ce warnings always come after notes 2020-11-21 01:49:19 +00:00
earthlng c6ddda1aa3 Update troubleshooter.js
- add `privacy.window.name.update.enabled`
- remove `media.autoplay.enabled` (removed in FF63)
- remove `dom.indexedDB.enabled` (removed in FF72)
2020-11-17 19:17:59 +00:00
Thorin-Oakenpants ccbca41e2d start 83 alpha, fixup 1244 setting info
`browser.preferences.exposeHTTPSOnly` is now default true
2020-11-13 01:03:29 +00:00
Thorin-Oakenpants 5b0d173078 82 final 2020-11-13 00:55:45 +00:00
Thorin-Oakenpants d6186819f4 domIntersectionObserver
it was removed after 81-beta was released
2020-11-11 18:42:29 +00:00
Thorin-Oakenpants ea0eb85404 82-beta 2020-11-11 18:23:00 +00:00
Thorin-Oakenpants 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
Thorin-Oakenpants 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
Thorin-Oakenpants f2fe7f02b0 add 2624: window.name protection, fixes #1012 2020-11-11 16:59:27 +00:00
Thorin-Oakenpants accef19af4 add LSNG, fixes #1059 2020-11-11 16:27:43 +00:00
Thorin-Oakenpants 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
Thorin-Oakenpants 07cccd5386 remove 4003: partition, see #1051 (#1057) 2020-11-02 17:05:40 +00:00
Thorin-Oakenpants ac52886ea8 2422 WASM, add reason for disabling, fixes #1037 (#1054) 2020-10-26 10:37:49 +00:00
Thorin-Oakenpants c45780d79b 0701 PHP localhost + IPv6, fixes #1053 2020-10-26 10:34:54 +00:00
Thorin-Oakenpants e14732aad3 2031: better reference: closes #1022 (#1048) 2020-10-23 23:29:31 +00:00
earthlng 26d4768447 add media.autoplay.blocking_policy 2020-10-21 13:44:21 +00:00
Thorin-Oakenpants 9f99885272 clean up acknowledgments 2020-10-20 12:57:00 +00:00
Thorin-Oakenpants 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
Thorin-Oakenpants f591a8adf8 82-alpha, 82 deprecated, remove old deprecated 2020-10-13 14:12:53 +00:00
Thorin-Oakenpants 0e10a820d9 81 final 2020-10-13 14:01:41 +00:00
earthlng c90341dded 1244: HTTPS-Only mode update (#1031) 2020-10-07 12:10:24 +00:00
Thorin-Oakenpants 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
Thorin-Oakenpants e89f9a5d89 dom.IntersectionObserver.enabled
commit: https://github.com/arkenfox/user.js/commit/a56ba859363f87d45b860b51560a9a3072f33b84
issue: #1026
2020-10-02 08:36:15 +00:00
Thorin-Oakenpants 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
Thorin-Oakenpants 421f1e361c [ ] are for for prefs only 2020-09-29 06:10:57 +00:00
Thorin-Oakenpants 2391874e04 UI setting change in 81
https://bugzilla.mozilla.org/show_bug.cgi?id=1613468
2020-09-28 19:04:08 +00:00
Thorin-Oakenpants 4779ea7850 remove CSP issue, closes #1021 2020-09-27 00:47:09 +00:00
Thorin-Oakenpants c367beabe3 81-beta 2020-09-23 12:20:59 +00:00
earthlng 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 https://github.com/arkenfox/user.js/pull/910/commits/4fbb2be98d8d156efd0f172e24cbbf77591ef4fc
2020-09-15 13:36:39 +00:00
earthlng ee3e5f0186 v4.12: arkenfox 2020-09-15 12:04:54 +00:00
earthlng 42b7650d42 v2.8: arkenfox 2020-09-15 11:58:52 +00:00
earthlng f61d4a0d38 Update prefsCleaner.sh 2020-09-15 11:55:28 +00:00
Thorin-Oakenpants 7fe9784bf8 we no longer have github pages 2020-09-15 06:18:54 +00:00
Thorin-Oakenpants ed05c64482 we no longer have github pages 2020-09-15 06:18:33 +00:00
Thorin-Oakenpants 16c3658040 align look with TZP 2020-09-15 06:17:44 +00:00
Thorin-Oakenpants 515d6ff874 v2.3: update repo name 2020-09-15 06:11:35 +00:00
Thorin-Oakenpants fc65052286 migration: cleanup code references 2020-09-15 06:07:32 +00:00
Thorin-Oakenpants 6a107d4d2f migration: cleanup code references 2020-09-15 06:06:32 +00:00
Thorin-Oakenpants eff4b74130 migration: cleanup code references 2020-09-15 06:05:33 +00:00
Thorin-Oakenpants 2532ddcc18 update name 2020-09-15 05:59:51 +00:00
Thorin-Oakenpants 44e22835c1 update name 2020-09-15 05:58:39 +00:00
Thorin-Oakenpants 1f545312fd update names + links 2020-09-15 05:57:30 +00:00
Thorin-Oakenpants 637e5964db update links 2020-09-15 05:56:00 +00:00
Thorin-Oakenpants 26bca612d7 rename as arkenfox 2020-09-15 05:54:22 +00:00
Thorin-Oakenpants 6fdda5fb62 rename as arkenfox 2020-09-15 05:53:09 +00:00
Thorin-Oakenpants ed5b158777 Rename ghacks-clear-RFP-alternatives.js to arkenfox-clear-RFP-alternatives.js 2020-09-15 05:52:28 +00:00
Thorin-Oakenpants 4c4270f1d7 migration changes 2020-09-15 04:33:50 +00:00
Thorin-Oakenpants af51631597 Update LICENSE.txt 2020-09-15 04:19:03 +00:00
Thorin-Oakenpants ae0c980d25 migration 2020-09-15 04:15:03 +00:00
earthlng 3e4c56cf27 arkenfox support
also fixes mixed line endings
2020-09-13 12:16:21 +00:00
Thorin-Oakenpants 18112f9ae8 last F time :) update TZP links 2020-09-11 21:55:12 +00:00
Thorin-Oakenpants c8eee094e0 update links 2020-09-11 03:23:55 +00:00
Thorin-Oakenpants 78a7c194eb update ref links 2020-09-10 07:33:50 +00:00
Thorin-Oakenpants 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
Thorin-Oakenpants 9c98972d14 misc2 (#1010)
* forceMediaMemoryCache breakage

* add back ESR68-EOL for prefsCleaner users
2020-09-05 15:42:34 +00:00
Thorin-Oakenpants 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
Thorin-Oakenpants 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
Thorin-Oakenpants 3c2bd930c3 start 81-alpha, EOL for ESR68 2020-09-03 13:11:16 +00:00
Thorin-Oakenpants ed993d5502 80 final 2020-09-03 13:04:31 +00:00
Thorin-Oakenpants 22d2d702be 1409: obsolete RFP mention 2020-09-03 13:02:09 +00:00
Diogo Agostinho 8dacf6e91f fix typo (#1005) 2020-08-31 21:47:57 +00:00
Thorin-Oakenpants 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
Thorin-Oakenpants 5fd7f6de7e 80-alpha 2020-08-28 18:27:20 +00:00
h88e22dgpeps56sg 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
Thorin-Oakenpants c6f53c8768 2201 deprecated (dead prefs removed in 82), #979 (#1002) 2020-08-26 11:28:47 +00:00
Thorin-Oakenpants 38d772e4c8 https-only mode updates (#1001) 2020-08-25 14:59:41 +00:00
Thorin-Oakenpants cfce521919 1409: RFP changes in FF81+ (#998) 2020-08-23 14:37:18 +00:00
Thorin-Oakenpants a5ab3e23d6 Update README.md 2020-08-22 22:16:27 +00:00
h88e22dgpeps56sg 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
Thorin-Oakenpants 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
Thorin-Oakenpants 9a37e1340c 0905: add reference, #982 2020-08-20 17:18:22 +00:00
Thorin-Oakenpants f1e0203ef4 0105b, cleaner value, see #992 2020-08-15 01:56:01 +00:00
Thorin-Oakenpants 726d5bde30 0105b: stop console error, closes #992 2020-08-14 14:12:28 +00:00
Thorin-Oakenpants f9f0fffd27 Update README.md 2020-08-14 09:01:14 +00:00
Thorin-Oakenpants 93840ca181 0602 not hidden in ESR78 2020-08-13 15:37:25 +00:00
Thorin-Oakenpants 99aa5af356 password master->primary 2020-08-13 15:34:26 +00:00
Thorin-Oakenpants 0358fdac8b 80-alpha 2020-08-13 15:32:45 +00:00
Thorin-Oakenpants 815c3026b5 79 final 2020-08-13 15:30:36 +00:00
Thorin-Oakenpants 5ed3047b7a references cleanup 2020-08-13 15:22:38 +00:00
16 changed files with 457 additions and 575 deletions
@@ -8,16 +8,16 @@ assignees: ''
---
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`
- searching the `[Setup` tags in the `user.js`
- Search the GitHub repository. The information you need is most likely here already.
- Note: We do not support forks
See also:
- Extension breakage due to prefs [issue 391](https://github.com/ghacksuserjs/ghacks-user.js/issues/391)
- Prefs vs Recommended Extensions: Co-Existance+Enhancement | Conflicts [issue 350](https://github.com/ghacksuserjs/ghacks-user.js/issues/350)
- The extension CSP header modification game [issue 664](https://github.com/ghacksuserjs/ghacks-user.js/issues/664)
- Override Recipes [issue 1080](https://github.com/arkenfox/user.js/issues/1080)
- 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/arkenfox/user.js/issues/350)
If you still need help, help us help you by providing relevant information:
- browser version
+1 -1
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.
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.
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017 ghacksuserjs
Copyright (c) 2020 arkenfox
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+17 -17
View File
@@ -1,27 +1,27 @@
### ![][b] 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.
### 🟪 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/arkenfox/user.js/wiki/1.1-Overview) wiki page.
### ![][b] ghacks 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).
### 🟩 the arkenfox user.js
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.
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
Literally thousands of sources, references and suggestions. That said...
- [Releases](https://github.com/arkenfox/user.js/releases)
- [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>
* The ghacks community and commentators
* [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)
### 🟥 acknowledgments
Literally thousands of sources, references and suggestions. Many thanks, and much appreciated.
<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
+1 -1
View File
@@ -1,3 +1,3 @@
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
+19 -3
View File
@@ -3,7 +3,7 @@ TITLE prefs.js cleaner
REM ### prefs.js cleaner for Windows
REM ## author: @claustromaniac
REM ## version: 2.2
REM ## version: 2.4
CD /D "%~dp0"
@@ -13,7 +13,7 @@ ECHO:
ECHO ########################################
ECHO #### prefs.js cleaner for Windows ####
ECHO #### by claustromaniac ####
ECHO #### v2.2 ####
ECHO #### v2.4 ####
ECHO ########################################
ECHO:
CALL :message "This script should be run from your Firefox profile directory."
@@ -28,6 +28,7 @@ IF ERRORLEVEL 3 (EXIT /B)
IF ERRORLEVEL 2 (GOTO :showhelp)
IF NOT EXIST "user.js" (CALL :abort "user.js not found in the current directory." 30)
IF NOT EXIST "prefs.js" (CALL :abort "prefs.js not found in the current directory." 30)
CALL :strlenCheck
CALL :FFcheck
CALL :message "Backing up prefs.js..."
SET "_time=%time: =0%"
@@ -50,6 +51,21 @@ ECHO:
ECHO: %~1
ECHO:
GOTO :EOF
REM ### string length Check Function ####
:strlenCheck
SET /a cnt=0
setlocal ENABLEDELAYEDEXPANSION
FOR /F "tokens=1,* delims=:" %%G IN ('FINDSTR /N "^" prefs.js') DO (
ECHO:%%H >nul
SET /a cnt += 1
IF /I "%%G" NEQ "!cnt!" (
ECHO:
CALL :message "ERROR: line !cnt! in prefs.js is too long."
(CALL :abort "Aborting ..." 30)
)
)
endlocal
GOTO :EOF
REM ####### Firefox Check Function ######
:FFcheck
TASKLIST /FI "IMAGENAME eq firefox.exe" 2>NUL | FIND /I /N "firefox.exe">NUL
@@ -101,7 +117,7 @@ ECHO add-ons disabled. Then, restart it again normally, and see if the
CALL :message " problems were solved."
ECHO:
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:
PAUSE
+3 -3
View File
@@ -2,7 +2,7 @@
## prefs.js cleaner for Linux/Mac
## 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
@@ -58,7 +58,7 @@ echo -e "\n\n"
echo " ╔══════════════════════════╗"
echo " ║ prefs.js cleaner ║"
echo " ║ by claustromaniac ║"
echo " ║ v1.2 ║"
echo " ║ v1.3 ║"
echo " ╚══════════════════════════╝"
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."
@@ -90,7 +90,7 @@ select option in Start Help Exit; do
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 "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)
fQuit 0
@@ -2,11 +2,11 @@
Version: up to and including FF/ESR78
This will reset the preferences that are under sections 4600 & 4700 in the
ghacks user.js. These are the prefs that are no longer necessary, or they
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:
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() {
@@ -2,12 +2,12 @@
Version: up to and including FF/ESR78
This will reset the preferences that have been deprecated by Mozilla
and used in the ghacks user.js
and used in the arkenfox user.js
It is in reverse order, so feel free to remove sections that do not apply
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() {
@@ -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: 28-July-2020
Last updated: 26-Jan-2021
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() {
let ops = [
/* removed in ghacks user.js v52-57 */
/* removed in arkenfox user.js v52-57 */
/* 52-alpha */
'browser.search.reset.enabled',
'browser.search.reset.whitelist',
@@ -223,6 +223,17 @@
'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',
/* 84-beta */
'browser.newtabpage.activity-stream.asrouter.providers.snippets',
'layout.css.visited_links_enabled',
/* 85-beta */
'network.http.redirection-limit',
/* reset parrot: check your open about:config after running the script */
'_user.js.parrot'
]
+16 -18
View File
@@ -1,5 +1,5 @@
/*** ghacks-user.js troubleshooter.js v1.6.1 ***/
/*** arkenfox user.js troubleshooter.js v1.6.3 ***/
(function() {
@@ -17,9 +17,7 @@
/* Storage + Cache */
'browser.cache.offline.enable',
'dom.indexedDB.enabled',
'dom.storage.enabled',
'browser.storageManager.enabled',
'dom.storageManager.enabled',
/* Workers, Web + Push Notifications */
@@ -34,7 +32,6 @@
/* Fonts */
'browser.display.use_document_fonts',
'font.blacklist.underline_offset',
'gfx.downloadable_fonts.woff2.enabled',
'gfx.font_rendering.graphite.enabled',
'gfx.font_rendering.opentype_svg.enabled',
'layout.css.font-loading-api.enabled',
@@ -47,12 +44,10 @@
'dom.IntersectionObserver.enabled',
'dom.popup_allowed_events',
'full-screen-api.enabled',
'geo.wifi.uri',
'intl.accept_languages',
'javascript.options.asmjs',
'javascript.options.wasm',
'permissions.default.shortcuts',
'security.csp.experimentalEnabled',
/* Hardware */
'dom.vr.enabled',
@@ -60,8 +55,8 @@
/* Audio + Video */
'dom.webaudio.enabled',
'media.autoplay.enabled',
'media.autoplay.default', // FF63+
'media.autoplay.blocking_policy', // FF78+
/* Forms */
'browser.formfill.enable',
@@ -88,13 +83,11 @@
/* Plugins + Flash */
'plugin.default.state',
'plugin.defaultXpi.state',
'plugin.sessionPermissionNow.intervalInMinutes',
'plugin.state.flash',
/* unlikely to cause problems */
'browser.tabs.remote.allowLinkedWebInFileUriProcess',
'dom.popup_maximum',
'geo.provider.network.url',
'layout.css.visited_links_enabled',
'mathml.disabled',
'network.auth.subresource-http-auth-allow',
@@ -102,6 +95,7 @@
'network.protocol-handler.external.ms-windows-store',
'privacy.trackingprotection.enabled',
'security.data_uri.block_toplevel_data_uri_navigations',
'privacy.window.name.update.enabled', // FF82+
'last.one.without.comma'
]
@@ -167,8 +161,8 @@
reapply(aALL);
myreset(aTmp.slice(0, _h(aTmp)));
while (aTmp.length) {
alert("NOW TEST AGAIN !");
if (confirm("if the problem still exists click OK, otherwise click cancel.")) {
alert('NOW TEST AGAIN !');
if (confirm('if the problem still exists click OK, otherwise click Cancel.')) {
aTmp = aTmp.slice(_h(aTmp));
} else {
aTmp = aTmp.slice(0, _h(aTmp));
@@ -182,16 +176,16 @@
if (aDbg.length == 1) return alert("narrowed it down to:\n\n"+aDbg[0].name+"\n");
if (aDbg.length == aALL.length) {
let msg = "Failed to narrow it down beyond the initial "+aALL.length+" prefs. The problem is most likely caused by at least 2 prefs!\n\n";
msg += "Either those prefs are too far apart in the list or there are exactly 2 culprits and they just happen to be at the wrong place.\n\n";
msg += "In case it's the latter, the script can add a dummy pref and you can try again - Try again?";
const msg = "Failed to narrow it down beyond the initial "+aALL.length+" prefs. The problem is most likely caused by at least 2 prefs!\n\n" +
"Either those prefs are too far apart in the list or there are exactly 2 culprits and they just happen to be at the wrong place.\n\n" +
"In case it's the latter, the script can add a dummy pref and you can try again - Try again?";
if (confirm(msg)) return _main([...aALL, oFILLER]);
} else if (aDbg.length > 10 && confirm("Narrowed it down to "+aDbg.length+" prefs. Try narrowing it down further?")) {
return _main(aDbg.reverse());
}
alert("Narrowed it down to "+ aDbg.length.toString() +" prefs, check the console ...");
console.log("The problem is caused by 2 or more of these prefs:");
console.log('The problem is caused by 2 or more of these prefs:');
for (const oPref of aDbg) console.log(oPref.name);
}
@@ -200,14 +194,18 @@
const aBAK = getMyList(aPREFS);
//console.log(aBAK.length, "user-set prefs from our list detected and their values stored.");
const sMsg = "all detected prefs reset.\n\n" +
"!! KEEP THIS PROMPT OPEN AND TEST THE SITE IN ANOTHER TAB !!\n\n" +
"IF the problem still exists, this script can't help you - click Cancel to re-apply your values and exit.\n\n" +
"Click OK if your problem is fixed.";
focus();
myreset(aBAK);
if (!confirm("all detected prefs reset.\n\n!! KEEP THIS PROMPT OPEN AND TEST THE SITE IN ANOTHER TAB !!\n\nIF the problem still exists, this script can't help you - click cancel to re-apply your values and exit.\n\nClick OK if your problem is fixed.")) {
if (!confirm(sMsg)) {
reapply(aBAK);
return;
}
_main(aBAK);
})();
+34 -19
View File
@@ -1,12 +1,12 @@
@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 ## version: 4.10
REM ## instructions: https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.3-Updater-Scripts
REM ## version: 4.14
REM ## instructions: https://github.com/arkenfox/user.js/wiki/3.3-Updater-Scripts
SET v=4.10
SET v=4.14
VERIFY ON
CD /D "%~dp0"
@@ -28,6 +28,15 @@ SHIFT
GOTO parse
:endparse
FOR /F %%i IN ('PowerShell -Command "[Enum]::GetNames([Net.SecurityProtocolType]) -contains 'Tls12'"') DO (
IF "%%i" == "False" (
CALL :message "Your PowerShell version doesn't support TLS1.2 ^!"
ECHO: Instructions to update PowerShell are on the arkenfox wiki
PAUSE
EXIT
)
)
IF DEFINED _updateb (
REM The normal flow here goes from phase 1 to phase 2 and then phase 3.
IF NOT "!_myname:~0,9!"=="[updated]" (
@@ -51,9 +60,7 @@ IF DEFINED _updateb (
CALL :message "Updating script..."
REM Uncomment the next line and comment out the PowerShell call for testing.
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')"
) >nul 2>&1
CALL :psdownload https://raw.githubusercontent.com/arkenfox/user.js/master/updater.bat "[updated]!_myname!.bat"
IF EXIST "[updated]!_myname!.bat" (
START /min CMD /C "[updated]!_myname!.bat" !_myparams!
) ELSE (
@@ -100,7 +107,10 @@ IF NOT EXIST user.js (
)
:exitloop
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!"
) ELSE (CALL :message "Current user.js version not recognised.")
) ELSE (CALL :message "Current user.js version not recognised.")
@@ -108,7 +118,7 @@ IF NOT EXIST user.js (
ECHO:
IF NOT DEFINED _ua (
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 "Visit the wiki for more detailed information."
ECHO:
@@ -129,17 +139,15 @@ IF DEFINED _log (
)
IF EXIST user.js.new (DEL /F "user.js.new")
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')"
) >nul 2>&1
CALL :psdownload https://raw.githubusercontent.com/arkenfox/user.js/master/user.js "user.js.new"
IF EXIST user.js.new (
IF DEFINED _rfpalts (
CALL :message "Activating RFP Alternatives section..."
CALL :activate user.js.new "[SETUP-non-RFP]"
)
IF DEFINED _esr (
CALL :message "Activating ESR section..."
CALL :activate user.js.new ".x still uses all the following prefs"
)
IF DEFINED _esr (
CALL :message "Activating ESR section..."
CALL :activate user.js.new ".x still uses all the following prefs"
)
IF DEFINED _multi (
FORFILES /P user.js-overrides /M *.js >nul 2>&1
@@ -215,9 +223,16 @@ IF NOT "2"=="%_log%" (ECHO:)
ENDLOCAL
GOTO :EOF
::::::::::::::: Download :::::::::::::::
:psdownload
(
PowerShell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object Net.WebClient).DownloadFile('%~1', '%~2')"
) >nul 2>&1
GOTO :EOF
::::::::::::::: Activate Section :::::::::::::::
:activate
:: arg1 = file
:activate
:: arg1 = file
:: arg2 = line substring
SETLOCAL DisableDelayedExpansion
(
+73 -103
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
## ghacks-user.js updater for macOS and Linux
## arkenfox user.js updater for macOS and Linux
## version: 2.6
## version: 2.9
## Author: Pat Johnson (@overdodactyl)
## Additional contributors: @earthlng, @ema-pe, @claustromaniac
@@ -10,9 +10,9 @@
readonly CURRDIR=$(pwd)
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
readonly SCRIPT_DIR=$(dirname "${sfp}")
SCRIPT_FILE=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null)
[ -z "$SCRIPT_FILE" ] && SCRIPT_FILE=${BASH_SOURCE[0]}
readonly SCRIPT_DIR=$(dirname "${SCRIPT_FILE}")
#########################
@@ -42,27 +42,27 @@ ESR=false
# Download method priority: curl -> wget
DOWNLOAD_METHOD=''
if [[ $(command -v 'curl') ]]; then
DOWNLOAD_METHOD='curl'
DOWNLOAD_METHOD='curl --max-redirs 3 -so'
elif [[ $(command -v 'wget') ]]; then
DOWNLOAD_METHOD='wget'
DOWNLOAD_METHOD='wget --max-redirect 3 --quiet -O'
else
echo -e "${RED}This script requires curl or wget.\nProcess aborted${NC}"
exit 0
exit 1
fi
show_banner () {
echo -e "${BBLUE}\n"
echo ' ############################################################################'
echo ' #### ####'
echo ' #### ghacks user.js ####'
echo ' #### Hardening the Privacy and Security Settings of Firefox ####'
echo ' #### Maintained by @Thorin-Oakenpants and @earthlng ####'
echo ' #### Updater for macOS and Linux by @overdodactyl ####'
echo ' #### ####'
echo ' ############################################################################'
echo -e "${BBLUE}
############################################################################
#### ####
#### arkenfox user.js ####
#### Hardening the Privacy and Security Settings of Firefox ####
#### Maintained by @Thorin-Oakenpants and @earthlng ####
#### Updater for macOS and Linux by @overdodactyl ####
#### ####
############################################################################"
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() {
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 'Optional Arguments:'
echo -e "\t-h,\t\t Show this help message and exit."
echo -e "\t-p PROFILE,\t Path to your Firefox profile (if different than the dir of this script)"
echo -e "\t\t\t IMPORTANT: if the path include spaces, wrap the entire argument in quotes."
echo -e "\t-l, \t\t Choose your Firefox profile from a list"
echo -e "\t-u,\t\t Update updater.sh and execute silently. Do not seek confirmation."
echo -e "\t-d,\t\t Do not look for updates to updater.sh."
echo -e "\t-s,\t\t Silently update user.js. Do not seek confirmation."
echo -e "\t-b,\t\t Only keep one backup of each file."
echo -e "\t-c,\t\t Create a diff file comparing old and new user.js within userjs_diffs. "
echo -e "\t-o OVERRIDE,\t Filename or path to overrides file (if different than user-overrides.js)."
echo -e "\t\t\t If used with -p, paths should be relative to PROFILE or absolute paths"
echo -e "\t\t\t If given a directory, all files inside will be appended recursively."
echo -e "\t\t\t You can pass multiple files or directories by passing a comma separated list."
echo -e "\t\t\t\t Note: If a directory is given, only files inside ending in the extension .js are appended"
echo -e "\t\t\t\t IMPORTANT: do not add spaces between files/paths. Ex: -o file1.js,file2.js,dir1"
echo -e "\t\t\t\t IMPORTANT: if any files/paths include spaces, wrap the entire argument in quotes."
echo -e "\t\t\t\t\t Ex: -o \"override folder\" "
echo -e "\t-n,\t\t Do not append any overrides, even if user-overrides.js exists."
echo -e "\t-v,\t\t Open the resulting user.js file."
echo -e "\t-r,\t\t Only download user.js to a temporary file and open it."
echo -e "\t-e,\t\t Activate ESR related preferences."
echo -e
echo 'Deprecated Arguments (they still work for now):'
echo -e "\t-donotupdate,\t Use instead -d"
echo -e "\t-update,\t Use instead -u"
echo -e
echo
echo -e "${BLUE}Usage: $0 [-bcdehlnrsuv] [-p PROFILE] [-o OVERRIDE]${NC}" 1>&2 # Echo usage string to standard error
echo -e "
Optional Arguments:
-h Show this help message and exit.
-p PROFILE Path to your Firefox profile (if different than the dir of this script)
IMPORTANT: If the path contains spaces, wrap the entire argument in quotes.
-l Choose your Firefox profile from a list
-u Update updater.sh and execute silently. Do not seek confirmation.
-d Do not look for updates to updater.sh.
-s Silently update user.js. Do not seek confirmation.
-b Only keep one backup of each file.
-c Create a diff file comparing old and new user.js within userjs_diffs.
-o OVERRIDE Filename or path to overrides file (if different than user-overrides.js).
If used with -p, paths should be relative to PROFILE or absolute paths
If given a directory, all files inside will be appended recursively.
You can pass multiple files or directories by passing a comma separated list.
Note: If a directory is given, only files inside ending in the extension .js are appended
IMPORTANT: Do not add spaces between files/paths. Ex: -o file1.js,file2.js,dir1
IMPORTANT: If any file/path contains spaces, wrap the entire argument in quotes.
Ex: -o \"override folder\"
-n Do not append any overrides, even if user-overrides.js exists.
-v Open the resulting user.js file.
-r Only download user.js to a temporary file and open it.
-e Activate ESR related preferences."
echo
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 #
#########################
# Download files
download_file () {
declare -r url=$1
download_file () { # expects URL as argument ($1)
declare -r tf=$(mktemp)
local dlcmd=''
if [ $DOWNLOAD_METHOD = 'curl' ]; then
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)
$DOWNLOAD_METHOD "${tf}" "$1" && 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
open "$1"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
elif [ "$(uname -s | cut -c -5)" == "Linux" ]; then
xdg-open "$1"
else
echo -e "${RED}Error: Sorry, opening files is not supported for your OS.${NC}"
@@ -204,31 +188,30 @@ get_updater_version () {
# Update updater.sh
# Default: Check for update, if available, ask user if they want to execute it
# Args:
# -donotupdate: New version will not be looked for and update will not occur
# -update: Check for update, if available, execute without asking
# -d: New version will not be looked for and update will not occur
# -u: Check for update, if available, execute without asking
update_updater () {
if [ $UPDATE = 'no' ]; then
return 0 # User signified not to check for updates
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_FILE") < $(get_updater_version "${tmpfile}") ]]; then
if [ $UPDATE = 'check' ]; then
echo -e "There is a newer version of updater.sh available. ${RED}Update and execute Y/N?${NC}"
read -p "" -n 1 -r
echo -e "\n\n"
if [[ $REPLY =~ ^[Nn]$ ]]; then
return 0 # Update available, but user chooses not to update
fi
[[ $REPLY =~ ^[Nn]$ ]] && return 0 # Update available, but user chooses not to update
fi
else
return 0 # No update available
fi
mv "${tmpfile}" "${SCRIPT_DIR}/updater.sh"
chmod u+x "${SCRIPT_DIR}/updater.sh"
"${SCRIPT_DIR}/updater.sh" "$@" -d
exit 1
mv "${tmpfile}" "$SCRIPT_FILE"
chmod u+x "$SCRIPT_FILE"
"$SCRIPT_FILE" "$@" -d
exit 0
}
@@ -238,11 +221,7 @@ update_updater () {
# Returns version number of a user.js file
get_userjs_version () {
if [ -e $1 ]; then
echo "$(sed -n '4p' "$1")"
else
echo "Not detected."
fi
[ -e $1 ] && echo "$(sed -n '4p' "$1")" || echo "Not detected."
}
add_override () {
@@ -252,7 +231,7 @@ add_override () {
cat "$input" >> user.js
echo -e "Status: ${GREEN}Override file appended:${NC} ${input}"
elif [ -d "$input" ]; then
FSAVEIFS=$IFS
SAVEIFS=$IFS
IFS=$'\n\b' # Set IFS
FILES="${input}"/*.js
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
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 "\tFirefox profile: ${ORANGE}$(pwd)${NC}"
echo -e "\tAvailable online: ${ORANGE}$(get_userjs_version $newfile)${NC}"
echo -e "\tCurrently using: ${ORANGE}$(get_userjs_version user.js)\n${NC}\n"
echo -e "Please observe the following information:
Firefox profile: ${ORANGE}$(pwd)${NC}
Available online: ${ORANGE}$(get_userjs_version $newfile)${NC}
Currently using: ${ORANGE}$(get_userjs_version user.js)${NC}\n\n"
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}"
@@ -298,9 +278,7 @@ update_userjs () {
# backup user.js
mkdir -p userjs_backups
local bakname="userjs_backups/user.js.backup.$(date +"%Y-%m-%d_%H%M")"
if [ $BACKUP = 'single' ]; then
bakname='userjs_backups/user.js.backup'
fi
[ $BACKUP = 'single' ] && bakname='userjs_backups/user.js.backup'
cp user.js "$bakname" &>/dev/null
mv "${newfile}" user.js
@@ -336,14 +314,12 @@ update_userjs () {
echo -e "Status: ${GREEN}A diff file was created:${NC} ${PWD}/${diffname}"
else
echo -e "Warning: ${ORANGE}Your new user.js file appears to be identical. No diff file was created.${NC}"
if [ $BACKUP = 'multiple' ]; then
rm $bakname &>/dev/null
fi
[ $BACKUP = 'multiple' ] && rm $bakname &>/dev/null
fi
rm $past_nocomments $current_nocomments $pastuserjs &>/dev/null
fi
if [ "$VIEW" = true ]; then open_file "${PWD}/user.js"; fi
[ "$VIEW" = true ] && open_file "${PWD}/user.js"
}
#########################
@@ -351,16 +327,9 @@ update_userjs () {
#########################
if [ $# != 0 ]; then
readonly legacy_lc=$(echo $1 | tr '[A-Z]' '[a-z]')
# Display usage if first argument is -help or --help
if [ $1 = '--help' ] || [ $1 = '-help' ]; then
usage
elif [ $legacy_lc = '-donotupdate' ]; then
UPDATE='no'
legacy_argument $1
elif [ $legacy_lc = '-update' ]; then
UPDATE='yes'
legacy_argument $1
else
while getopts ":hp:ludsno:bcvre" opt; do
case $opt in
@@ -401,11 +370,12 @@ if [ $# != 0 ]; then
ESR=true
;;
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"
echo -e "${ORANGE}Warning: user.js was saved to temporary file ${tfile}.js${NC}"
open_file "${tfile}.js"
exit 1
exit 0
;;
\?)
echo -e "${RED}\n Error! Invalid option: -$OPTARG${NC}" >&2
@@ -413,7 +383,7 @@ if [ $# != 0 ]; then
;;
:)
echo -e "${RED}Error! Option -$OPTARG requires an argument.${NC}" >&2
exit 1
exit 2
;;
esac
done
+269 -397
View File
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