mirror of
https://github.com/arkenfox/user.js.git
synced 2025-09-01 01:18:30 +02:00
Compare commits
128 Commits
v76.0-beta
...
83.0
Author | SHA1 | Date | |
---|---|---|---|
94712f59a3 | |||
ef93a754ce | |||
c6ddda1aa3 | |||
ccbca41e2d | |||
5b0d173078 | |||
d6186819f4 | |||
ea0eb85404 | |||
8dc43cfdc2 | |||
f7bee988de | |||
f2fe7f02b0 | |||
accef19af4 | |||
910d7004c6 | |||
07cccd5386 | |||
ac52886ea8 | |||
c45780d79b | |||
e14732aad3 | |||
26d4768447 | |||
9f99885272 | |||
0adfddd1e2 | |||
f591a8adf8 | |||
0e10a820d9 | |||
c90341dded | |||
d5ccf4693b | |||
e89f9a5d89 | |||
a56ba85936 | |||
421f1e361c | |||
2391874e04 | |||
4779ea7850 | |||
c367beabe3 | |||
e1d336a178 | |||
ee3e5f0186 | |||
42b7650d42 | |||
f61d4a0d38 | |||
7fe9784bf8 | |||
ed05c64482 | |||
16c3658040 | |||
515d6ff874 | |||
fc65052286 | |||
6a107d4d2f | |||
eff4b74130 | |||
2532ddcc18 | |||
44e22835c1 | |||
1f545312fd | |||
637e5964db | |||
26bca612d7 | |||
6fdda5fb62 | |||
ed5b158777 | |||
4c4270f1d7 | |||
af51631597 | |||
ae0c980d25 | |||
3e4c56cf27 | |||
18112f9ae8 | |||
c8eee094e0 | |||
78a7c194eb | |||
f606c8b866 | |||
9c98972d14 | |||
75a03df0f7 | |||
76019e6fbe | |||
3c2bd930c3 | |||
ed993d5502 | |||
22d2d702be | |||
8dacf6e91f | |||
fbe1d48fe2 | |||
5fd7f6de7e | |||
592b959c24 | |||
c6f53c8768 | |||
38d772e4c8 | |||
cfce521919 | |||
a5ab3e23d6 | |||
b3eee6c9fd | |||
8d6d17d46b | |||
9a37e1340c | |||
f1e0203ef4 | |||
726d5bde30 | |||
f9f0fffd27 | |||
93840ca181 | |||
99aa5af356 | |||
0358fdac8b | |||
815c3026b5 | |||
5ed3047b7a | |||
e16ede1cdf | |||
6905187b3e | |||
172118e61b | |||
8452edb94b | |||
0f6957bbd4 | |||
8c2bcc0352 | |||
bc832575d8 | |||
c4b7e07691 | |||
58fb1db838 | |||
2809854802 | |||
091a71aade | |||
117ab133b1 | |||
c4a06c4689 | |||
0d27689c64 | |||
771e57480a | |||
f8fd03482d | |||
10cc1224d0 | |||
52926cca7a | |||
be64819ce7 | |||
24c228df92 | |||
892b3d9d69 | |||
df21798b81 | |||
46d03279d3 | |||
fe0af3bb34 | |||
84997386c1 | |||
1a389c0214 | |||
d0060fed3c | |||
3d18af19e3 | |||
b5b04454e0 | |||
618f7bed3f | |||
488a825626 | |||
aaf6cb33d7 | |||
77ecef8be3 | |||
4be0a80720 | |||
f573200aa8 | |||
48f258ff53 | |||
b9100488cb | |||
9d78e050ee | |||
b07cf1f03d | |||
683ef63b37 | |||
05580f5e99 | |||
ecc62554e5 | |||
f6e6de8444 | |||
f69d92e6dd | |||
3edc48da56 | |||
868882ae33 | |||
ff9bf76e52 | |||
4bc5b89cfe |
@ -8,16 +8,15 @@ 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)
|
||||
- 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
|
||||
|
2
.github/ISSUE_TEMPLATE/user-js.md
vendored
2
.github/ISSUE_TEMPLATE/user-js.md
vendored
@ -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,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
|
||||
|
34
README.md
34
README.md
@ -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.
|
||||
[](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] [](https://opensource.org/licenses/MIT)
|
||||
|
||||
[b]: /wikipiki/bullet01.png
|
||||
|
@ -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
|
||||
|
@ -3,7 +3,7 @@ TITLE prefs.js cleaner
|
||||
|
||||
REM ### prefs.js cleaner for Windows
|
||||
REM ## author: @claustromaniac
|
||||
REM ## version: 2.2
|
||||
REM ## version: 2.3
|
||||
|
||||
CD /D "%~dp0"
|
||||
|
||||
@ -13,7 +13,7 @@ ECHO:
|
||||
ECHO ########################################
|
||||
ECHO #### prefs.js cleaner for Windows ####
|
||||
ECHO #### by claustromaniac ####
|
||||
ECHO #### v2.2 ####
|
||||
ECHO #### v2.3 ####
|
||||
ECHO ########################################
|
||||
ECHO:
|
||||
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."
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -1,10 +1,12 @@
|
||||
/***
|
||||
This will reset the preferences that are under sections 4600 & 4700 in the ghacks user.js
|
||||
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.
|
||||
Version: up to and including FF/ESR78
|
||||
|
||||
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:
|
||||
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() {
|
||||
@ -24,6 +26,8 @@
|
||||
'webgl.enable-debug-renderer-info',
|
||||
'dom.w3c_pointer_events.enabled',
|
||||
'ui.use_standins_for_native_colors',
|
||||
'ui.systemUsesDarkTheme',
|
||||
'ui.prefersReducedMotion',
|
||||
/* section 4700 */
|
||||
'general.useragent.override',
|
||||
'general.buildID.override',
|
@ -1,17 +1,44 @@
|
||||
/***
|
||||
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 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
|
||||
|
||||
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 = [
|
||||
/* 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 */
|
||||
'browser.newtabpage.activity-stream.disableSnippets',
|
||||
'browser.aboutHomeSnippets.updateUrl',
|
@ -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: 12-April-2020
|
||||
Last updated: 02-Nov-2020
|
||||
|
||||
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',
|
||||
@ -221,6 +221,14 @@
|
||||
/* 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 */
|
||||
'_user.js.parrot'
|
||||
]
|
@ -1,5 +1,5 @@
|
||||
|
||||
/*** ghacks-user.js troubleshooter.js v1.6.1 ***/
|
||||
/*** arkenfox user.js troubleshooter.js v1.6.2 ***/
|
||||
|
||||
(function() {
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
|
||||
/* Storage + Cache */
|
||||
'browser.cache.offline.enable',
|
||||
'dom.indexedDB.enabled',
|
||||
'dom.storage.enabled',
|
||||
'browser.storageManager.enabled',
|
||||
'dom.storageManager.enabled',
|
||||
@ -60,8 +59,8 @@
|
||||
|
||||
/* Audio + Video */
|
||||
'dom.webaudio.enabled',
|
||||
'media.autoplay.enabled',
|
||||
'media.autoplay.default', // FF63+
|
||||
'media.autoplay.blocking_policy', // FF78+
|
||||
|
||||
/* Forms */
|
||||
'browser.formfill.enable',
|
||||
@ -102,6 +101,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'
|
||||
]
|
||||
|
33
updater.bat
33
updater.bat
@ -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.12
|
||||
REM ## instructions: https://github.com/arkenfox/user.js/wiki/3.3-Updater-Scripts
|
||||
|
||||
SET v=4.10
|
||||
SET v=4.12
|
||||
|
||||
VERIFY ON
|
||||
CD /D "%~dp0"
|
||||
@ -52,7 +52,7 @@ IF DEFINED _updateb (
|
||||
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')"
|
||||
PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/arkenfox/user.js/master/updater.bat', '[updated]!_myname!.bat')"
|
||||
) >nul 2>&1
|
||||
IF EXIST "[updated]!_myname!.bat" (
|
||||
START /min CMD /C "[updated]!_myname!.bat" !_myparams!
|
||||
@ -100,7 +100,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 +111,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:
|
||||
@ -130,16 +133,16 @@ 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')"
|
||||
PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/arkenfox/user.js/master/user.js', 'user.js.new')"
|
||||
) >nul 2>&1
|
||||
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
|
||||
@ -216,8 +219,8 @@ ENDLOCAL
|
||||
GOTO :EOF
|
||||
|
||||
::::::::::::::: Activate Section :::::::::::::::
|
||||
:activate
|
||||
:: arg1 = file
|
||||
:activate
|
||||
:: arg1 = file
|
||||
:: arg2 = line substring
|
||||
SETLOCAL DisableDelayedExpansion
|
||||
(
|
||||
|
170
updater.sh
170
updater.sh
@ -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.5
|
||||
## version: 2.8
|
||||
## Author: Pat Johnson (@overdodactyl)
|
||||
## Additional contributors: @earthlng, @ema-pe, @claustromaniac
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
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
|
||||
[ -z "$sfp" ] && sfp=${BASH_SOURCE[0]}
|
||||
readonly SCRIPT_DIR=$(dirname "${sfp}")
|
||||
|
||||
|
||||
@ -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,23 +188,22 @@ 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 [ $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
|
||||
@ -228,7 +211,7 @@ update_updater () {
|
||||
mv "${tmpfile}" "${SCRIPT_DIR}/updater.sh"
|
||||
chmod u+x "${SCRIPT_DIR}/updater.sh"
|
||||
"${SCRIPT_DIR}/updater.sh" "$@" -d
|
||||
exit 1
|
||||
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
|
||||
@ -313,8 +291,10 @@ update_userjs () {
|
||||
|
||||
# apply overrides
|
||||
if [ "$SKIPOVERRIDE" = false ]; then
|
||||
while IFS=',' read -ra FILE; do
|
||||
add_override "$FILE"
|
||||
while IFS=',' read -ra FILES; do
|
||||
for FILE in "${FILES[@]}"; do
|
||||
add_override "$FILE"
|
||||
done
|
||||
done <<< "$OVERRIDE"
|
||||
fi
|
||||
|
||||
@ -334,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"
|
||||
}
|
||||
|
||||
#########################
|
||||
@ -349,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
|
||||
@ -399,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
|
||||
@ -411,7 +383,7 @@ if [ $# != 0 ]; then
|
||||
;;
|
||||
:)
|
||||
echo -e "${RED}Error! Option -$OPTARG requires an argument.${NC}" >&2
|
||||
exit 1
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.1 KiB |
Reference in New Issue
Block a user