mirror of
https://github.com/arkenfox/user.js.git
synced 2025-09-01 17:38:30 +02:00
Compare commits
145 Commits
Author | SHA1 | Date | |
---|---|---|---|
da9f912862 | |||
9930cfbc07 | |||
7738e320d5 | |||
9b8735a87a | |||
6c10e03ce5 | |||
7ad3bb9e61 | |||
5dcf639d33 | |||
2da3b0192f | |||
ada8158caf | |||
2071939c5e | |||
f082278217 | |||
abe37add6e | |||
bc07ca94c0 | |||
728c962684 | |||
ca99add006 | |||
f771027138 | |||
8f1c0044b9 | |||
87cd828b5b | |||
46ccd9f654 | |||
b1927f9de1 | |||
b592e0e592 | |||
3b6cd93749 | |||
3a24c01f03 | |||
b7c80841a9 | |||
95645f59a3 | |||
9138e342fd | |||
692ed70ea9 | |||
3430507ae4 | |||
844f3ce9c8 | |||
03ffb90186 | |||
5f9bb59b95 | |||
7163efdd1e | |||
65fb24ff1b | |||
612cfbf313 | |||
4596d721e6 | |||
911206eed5 | |||
cb5cdca99d | |||
e54ae46537 | |||
7c978d4e70 | |||
d905b4387d | |||
c31c825a74 | |||
6505a9fefd | |||
de74f812ee | |||
82bb3f987d | |||
a35a616de7 | |||
ecf99bf9e7 | |||
cfaf354fe3 | |||
0b51e98d91 | |||
fa51251235 | |||
21fcd0bd35 | |||
96d558dd0c | |||
b6e8dcab81 | |||
fa78c53114 | |||
2f6b14ab6e | |||
2dd455ef83 | |||
306610da8e | |||
59ac1727f7 | |||
c974b3252d | |||
480933484f | |||
0cbd8a13a3 | |||
ae6c76fe54 | |||
1f098f2eaf | |||
11977e7017 | |||
27dd6aa62d | |||
c570e4fdbd | |||
da58f84fa6 | |||
755a45505f | |||
9d74cb9526 | |||
8c9d0bbe72 | |||
0152b38b8b | |||
e6cf90146a | |||
63d1258f2e | |||
46bab27f94 | |||
2cfbba1472 | |||
c980bda695 | |||
feaa1c3e99 | |||
aa1c2145bb | |||
335ee84540 | |||
5c37d50f4e | |||
77abf35761 | |||
fa85c9da5b | |||
cf53982086 | |||
91cbc1e09a | |||
a7e4268d8b | |||
699eacf1fd | |||
0189438e46 | |||
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 |
@ -8,16 +8,16 @@ 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)
|
- Override Recipes [issue 1080](https://github.com/arkenfox/user.js/issues/1080)
|
||||||
- Prefs vs Recommended Extensions: Co-Existance+Enhancement | Conflicts [issue 350](https://github.com/ghacksuserjs/ghacks-user.js/issues/350)
|
- Extension breakage due to prefs [issue 391](https://github.com/arkenfox/user.js/issues/391)
|
||||||
- The extension CSP header modification game [issue 664](https://github.com/ghacksuserjs/ghacks-user.js/issues/664)
|
- 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:
|
If you still need help, help us help you by providing relevant information:
|
||||||
- browser version
|
- 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.
|
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.
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
30
README.md
30
README.md
@ -1,23 +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] This user.js
|
### 🟩 the arkenfox user.js
|
||||||
This `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 `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.
|
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. Special mention to:
|
- [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)
|
||||||
|
|
||||||
* [12bytes](https://12bytes.org/articles/tech/firefox/firefoxgecko-configuration-guide-for-privacy-and-performance-buffs)
|
### 🟥 acknowledgments
|
||||||
* 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)
|
Literally thousands of sources, references and suggestions. Many thanks, and much appreciated.
|
||||||
|
|
||||||
### ![][b] [](https://opensource.org/licenses/MIT)
|
|
||||||
|
|
||||||
[b]: /wikipiki/bullet01.png
|
|
||||||
|
@ -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
|
||||||
|
@ -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.4
|
||||||
|
|
||||||
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.4 ####
|
||||||
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."
|
||||||
@ -28,6 +28,7 @@ IF ERRORLEVEL 3 (EXIT /B)
|
|||||||
IF ERRORLEVEL 2 (GOTO :showhelp)
|
IF ERRORLEVEL 2 (GOTO :showhelp)
|
||||||
IF NOT EXIST "user.js" (CALL :abort "user.js not found in the current directory." 30)
|
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)
|
IF NOT EXIST "prefs.js" (CALL :abort "prefs.js not found in the current directory." 30)
|
||||||
|
CALL :strlenCheck
|
||||||
CALL :FFcheck
|
CALL :FFcheck
|
||||||
CALL :message "Backing up prefs.js..."
|
CALL :message "Backing up prefs.js..."
|
||||||
SET "_time=%time: =0%"
|
SET "_time=%time: =0%"
|
||||||
@ -50,6 +51,21 @@ ECHO:
|
|||||||
ECHO: %~1
|
ECHO: %~1
|
||||||
ECHO:
|
ECHO:
|
||||||
GOTO :EOF
|
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 ######
|
REM ####### Firefox Check Function ######
|
||||||
:FFcheck
|
:FFcheck
|
||||||
TASKLIST /FI "IMAGENAME eq firefox.exe" 2>NUL | FIND /I /N "firefox.exe">NUL
|
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."
|
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
|
||||||
|
@ -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
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
Version: up to and including FF/ESR78
|
Version: up to and including FF/ESR78
|
||||||
|
|
||||||
This will reset the preferences that are under sections 4600 & 4700 in the
|
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.
|
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() {
|
@ -2,12 +2,12 @@
|
|||||||
Version: up to and including FF/ESR78
|
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
|
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() {
|
@ -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: 07-Apr-2021
|
||||||
|
|
||||||
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 */
|
||||||
/* 52-alpha */
|
/* 52-alpha */
|
||||||
'browser.search.reset.enabled',
|
'browser.search.reset.enabled',
|
||||||
'browser.search.reset.whitelist',
|
'browser.search.reset.whitelist',
|
||||||
@ -26,7 +26,6 @@
|
|||||||
'extensions.pocket.api', // covered by extensions.pocket.enabled
|
'extensions.pocket.api', // covered by extensions.pocket.enabled
|
||||||
'extensions.pocket.oAuthConsumerKey', // ditto
|
'extensions.pocket.oAuthConsumerKey', // ditto
|
||||||
'extensions.pocket.site', // ditto
|
'extensions.pocket.site', // ditto
|
||||||
/* 56-alpha: none */
|
|
||||||
/* 57-alpha */
|
/* 57-alpha */
|
||||||
'geo.wifi.xhr.timeout', // covered by geo.enabled
|
'geo.wifi.xhr.timeout', // covered by geo.enabled
|
||||||
'browser.search.geoip.timeout', // ditto
|
'browser.search.geoip.timeout', // ditto
|
||||||
@ -223,6 +222,22 @@
|
|||||||
'browser.search.region',
|
'browser.search.region',
|
||||||
/* 79-beta */
|
/* 79-beta */
|
||||||
'browser.urlbar.usepreloadedtopurls.enabled',
|
'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',
|
||||||
|
/* 85-beta */
|
||||||
|
'network.http.redirection-limit',
|
||||||
|
/* 86-beta */
|
||||||
|
'media.gmp-widevinecdm.visible',
|
||||||
|
/* 87-beta */
|
||||||
|
'browser.send_pings.require_same_host',
|
||||||
|
/* 88-beta */
|
||||||
|
'webgl.min_capability_mode',
|
||||||
/* 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'
|
||||||
]
|
]
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
/*** ghacks-user.js troubleshooter.js v1.6.1 ***/
|
/*** arkenfox user.js troubleshooter.js v1.6.3 ***/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
@ -17,9 +17,7 @@
|
|||||||
|
|
||||||
/* Storage + Cache */
|
/* Storage + Cache */
|
||||||
'browser.cache.offline.enable',
|
'browser.cache.offline.enable',
|
||||||
'dom.indexedDB.enabled',
|
|
||||||
'dom.storage.enabled',
|
'dom.storage.enabled',
|
||||||
'browser.storageManager.enabled',
|
|
||||||
'dom.storageManager.enabled',
|
'dom.storageManager.enabled',
|
||||||
|
|
||||||
/* Workers, Web + Push Notifications */
|
/* Workers, Web + Push Notifications */
|
||||||
@ -34,7 +32,6 @@
|
|||||||
/* Fonts */
|
/* Fonts */
|
||||||
'browser.display.use_document_fonts',
|
'browser.display.use_document_fonts',
|
||||||
'font.blacklist.underline_offset',
|
'font.blacklist.underline_offset',
|
||||||
'gfx.downloadable_fonts.woff2.enabled',
|
|
||||||
'gfx.font_rendering.graphite.enabled',
|
'gfx.font_rendering.graphite.enabled',
|
||||||
'gfx.font_rendering.opentype_svg.enabled',
|
'gfx.font_rendering.opentype_svg.enabled',
|
||||||
'layout.css.font-loading-api.enabled',
|
'layout.css.font-loading-api.enabled',
|
||||||
@ -47,12 +44,10 @@
|
|||||||
'dom.IntersectionObserver.enabled',
|
'dom.IntersectionObserver.enabled',
|
||||||
'dom.popup_allowed_events',
|
'dom.popup_allowed_events',
|
||||||
'full-screen-api.enabled',
|
'full-screen-api.enabled',
|
||||||
'geo.wifi.uri',
|
|
||||||
'intl.accept_languages',
|
'intl.accept_languages',
|
||||||
'javascript.options.asmjs',
|
'javascript.options.asmjs',
|
||||||
'javascript.options.wasm',
|
'javascript.options.wasm',
|
||||||
'permissions.default.shortcuts',
|
'permissions.default.shortcuts',
|
||||||
'security.csp.experimentalEnabled',
|
|
||||||
|
|
||||||
/* Hardware */
|
/* Hardware */
|
||||||
'dom.vr.enabled',
|
'dom.vr.enabled',
|
||||||
@ -60,8 +55,8 @@
|
|||||||
|
|
||||||
/* Audio + Video */
|
/* Audio + Video */
|
||||||
'dom.webaudio.enabled',
|
'dom.webaudio.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',
|
||||||
@ -88,13 +83,11 @@
|
|||||||
|
|
||||||
/* Plugins + Flash */
|
/* Plugins + Flash */
|
||||||
'plugin.default.state',
|
'plugin.default.state',
|
||||||
'plugin.defaultXpi.state',
|
|
||||||
'plugin.sessionPermissionNow.intervalInMinutes',
|
|
||||||
'plugin.state.flash',
|
'plugin.state.flash',
|
||||||
|
|
||||||
/* unlikely to cause problems */
|
/* unlikely to cause problems */
|
||||||
'browser.tabs.remote.allowLinkedWebInFileUriProcess',
|
|
||||||
'dom.popup_maximum',
|
'dom.popup_maximum',
|
||||||
|
'geo.provider.network.url',
|
||||||
'layout.css.visited_links_enabled',
|
'layout.css.visited_links_enabled',
|
||||||
'mathml.disabled',
|
'mathml.disabled',
|
||||||
'network.auth.subresource-http-auth-allow',
|
'network.auth.subresource-http-auth-allow',
|
||||||
@ -102,6 +95,7 @@
|
|||||||
'network.protocol-handler.external.ms-windows-store',
|
'network.protocol-handler.external.ms-windows-store',
|
||||||
'privacy.trackingprotection.enabled',
|
'privacy.trackingprotection.enabled',
|
||||||
'security.data_uri.block_toplevel_data_uri_navigations',
|
'security.data_uri.block_toplevel_data_uri_navigations',
|
||||||
|
'privacy.window.name.update.enabled', // FF82+
|
||||||
|
|
||||||
'last.one.without.comma'
|
'last.one.without.comma'
|
||||||
]
|
]
|
||||||
@ -167,8 +161,8 @@
|
|||||||
reapply(aALL);
|
reapply(aALL);
|
||||||
myreset(aTmp.slice(0, _h(aTmp)));
|
myreset(aTmp.slice(0, _h(aTmp)));
|
||||||
while (aTmp.length) {
|
while (aTmp.length) {
|
||||||
alert("NOW TEST AGAIN !");
|
alert('NOW TEST AGAIN !');
|
||||||
if (confirm("if the problem still exists click OK, otherwise click cancel.")) {
|
if (confirm('if the problem still exists click OK, otherwise click Cancel.')) {
|
||||||
aTmp = aTmp.slice(_h(aTmp));
|
aTmp = aTmp.slice(_h(aTmp));
|
||||||
} else {
|
} else {
|
||||||
aTmp = aTmp.slice(0, _h(aTmp));
|
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 == 1) return alert("narrowed it down to:\n\n"+aDbg[0].name+"\n");
|
||||||
if (aDbg.length == aALL.length) {
|
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";
|
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" +
|
||||||
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";
|
"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?";
|
"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]);
|
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?")) {
|
} else if (aDbg.length > 10 && confirm("Narrowed it down to "+aDbg.length+" prefs. Try narrowing it down further?")) {
|
||||||
return _main(aDbg.reverse());
|
return _main(aDbg.reverse());
|
||||||
}
|
}
|
||||||
|
|
||||||
alert("Narrowed it down to "+ aDbg.length.toString() +" prefs, check the console ...");
|
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);
|
for (const oPref of aDbg) console.log(oPref.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,13 +195,17 @@
|
|||||||
const aBAK = getMyList(aPREFS);
|
const aBAK = getMyList(aPREFS);
|
||||||
//console.log(aBAK.length, "user-set prefs from our list detected and their values stored.");
|
//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();
|
focus();
|
||||||
myreset(aBAK);
|
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);
|
reapply(aBAK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_main(aBAK);
|
_main(aBAK);
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
41
updater.bat
41
updater.bat
@ -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.14
|
||||||
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.14
|
||||||
|
|
||||||
VERIFY ON
|
VERIFY ON
|
||||||
CD /D "%~dp0"
|
CD /D "%~dp0"
|
||||||
@ -28,6 +28,15 @@ SHIFT
|
|||||||
GOTO parse
|
GOTO parse
|
||||||
:endparse
|
: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 (
|
IF DEFINED _updateb (
|
||||||
REM The normal flow here goes from phase 1 to phase 2 and then phase 3.
|
REM The normal flow here goes from phase 1 to phase 2 and then phase 3.
|
||||||
IF NOT "!_myname:~0,9!"=="[updated]" (
|
IF NOT "!_myname:~0,9!"=="[updated]" (
|
||||||
@ -51,9 +60,7 @@ IF DEFINED _updateb (
|
|||||||
CALL :message "Updating script..."
|
CALL :message "Updating script..."
|
||||||
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
|
||||||
(
|
CALL :psdownload https://raw.githubusercontent.com/arkenfox/user.js/master/updater.bat "[updated]!_myname!.bat"
|
||||||
PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/updater.bat', '[updated]!_myname!.bat')"
|
|
||||||
) >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!
|
||||||
) ELSE (
|
) ELSE (
|
||||||
@ -100,7 +107,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 +118,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:
|
||||||
@ -129,9 +139,7 @@ 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..."
|
||||||
(
|
CALL :psdownload https://raw.githubusercontent.com/arkenfox/user.js/master/user.js "user.js.new"
|
||||||
PowerShell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/ghacksuserjs/ghacks-user.js/master/user.js', 'user.js.new')"
|
|
||||||
) >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..."
|
||||||
@ -215,6 +223,13 @@ IF NOT "2"=="%_log%" (ECHO:)
|
|||||||
ENDLOCAL
|
ENDLOCAL
|
||||||
GOTO :EOF
|
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 Section :::::::::::::::
|
||||||
:activate
|
:activate
|
||||||
:: arg1 = file
|
:: arg1 = file
|
||||||
|
93
updater.sh
93
updater.sh
@ -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.7
|
## version: 3.0
|
||||||
## Author: Pat Johnson (@overdodactyl)
|
## Author: Pat Johnson (@overdodactyl)
|
||||||
## Additional contributors: @earthlng, @ema-pe, @claustromaniac
|
## Additional contributors: @earthlng, @ema-pe, @claustromaniac
|
||||||
|
|
||||||
@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
readonly CURRDIR=$(pwd)
|
readonly CURRDIR=$(pwd)
|
||||||
|
|
||||||
sfp=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null)
|
SCRIPT_FILE=$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null)
|
||||||
[ -z "$sfp" ] && sfp=${BASH_SOURCE[0]}
|
[ -z "$SCRIPT_FILE" ] && SCRIPT_FILE=${BASH_SOURCE[0]}
|
||||||
readonly SCRIPT_DIR=$(dirname "${sfp}")
|
readonly SCRIPT_DIR=$(dirname "${SCRIPT_FILE}")
|
||||||
|
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
@ -47,7 +47,7 @@ elif [[ $(command -v 'wget') ]]; then
|
|||||||
DOWNLOAD_METHOD='wget --max-redirect 3 --quiet -O'
|
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
|
||||||
|
|
||||||
|
|
||||||
@ -55,14 +55,14 @@ show_banner () {
|
|||||||
echo -e "${BBLUE}
|
echo -e "${BBLUE}
|
||||||
############################################################################
|
############################################################################
|
||||||
#### ####
|
#### ####
|
||||||
#### ghacks user.js ####
|
#### arkenfox user.js ####
|
||||||
#### Hardening the Privacy and Security Settings of Firefox ####
|
#### Hardening the Privacy and Security Settings of Firefox ####
|
||||||
#### Maintained by @Thorin-Oakenpants and @earthlng ####
|
#### Maintained by @Thorin-Oakenpants and @earthlng ####
|
||||||
#### Updater for macOS and Linux by @overdodactyl ####
|
#### Updater for macOS and Linux by @overdodactyl ####
|
||||||
#### ####
|
#### ####
|
||||||
############################################################################"
|
############################################################################"
|
||||||
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
@ -76,7 +76,7 @@ usage() {
|
|||||||
Optional Arguments:
|
Optional Arguments:
|
||||||
-h Show this help message and exit.
|
-h Show this help message and exit.
|
||||||
-p PROFILE Path to your Firefox profile (if different than the dir of this script)
|
-p PROFILE Path to your Firefox profile (if different than the dir of this script)
|
||||||
IMPORTANT: if the path includes spaces, wrap the entire argument in quotes.
|
IMPORTANT: If the path contains spaces, wrap the entire argument in quotes.
|
||||||
-l Choose your Firefox profile from a list
|
-l Choose your Firefox profile from a list
|
||||||
-u Update updater.sh and execute silently. Do not seek confirmation.
|
-u Update updater.sh and execute silently. Do not seek confirmation.
|
||||||
-d Do not look for updates to updater.sh.
|
-d Do not look for updates to updater.sh.
|
||||||
@ -88,8 +88,8 @@ Optional Arguments:
|
|||||||
If given a directory, all files inside will be appended recursively.
|
If given a directory, all files inside will be appended recursively.
|
||||||
You can pass multiple files or directories by passing a comma separated list.
|
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
|
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: Do not add spaces between files/paths. Ex: -o file1.js,file2.js,dir1
|
||||||
IMPORTANT: if any files/paths include spaces, wrap the entire argument in quotes.
|
IMPORTANT: If any file/path contains spaces, wrap the entire argument in quotes.
|
||||||
Ex: -o \"override folder\"
|
Ex: -o \"override folder\"
|
||||||
-n Do not append any overrides, even if user-overrides.js exists.
|
-n Do not append any overrides, even if user-overrides.js exists.
|
||||||
-v Open the resulting user.js file.
|
-v Open the resulting user.js file.
|
||||||
@ -103,14 +103,13 @@ Optional Arguments:
|
|||||||
# File Handling #
|
# File Handling #
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
# Download files
|
|
||||||
download_file () { # expects URL as argument ($1)
|
download_file () { # expects URL as argument ($1)
|
||||||
declare -r tf=$(mktemp)
|
declare -r tf=$(mktemp)
|
||||||
|
|
||||||
$DOWNLOAD_METHOD "${tf}" "$1" && 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
|
if [ "$(uname)" == 'Darwin' ]; then
|
||||||
open "$1"
|
open "$1"
|
||||||
elif [ "$(uname -s | cut -c -5)" == "Linux" ]; then
|
elif [ "$(uname -s | cut -c -5)" == "Linux" ]; then
|
||||||
@ -122,36 +121,33 @@ open_file () { #expects one argument: file_path
|
|||||||
|
|
||||||
readIniFile () { # expects one argument: absolute path of profiles.ini
|
readIniFile () { # expects one argument: absolute path of profiles.ini
|
||||||
declare -r inifile="$1"
|
declare -r inifile="$1"
|
||||||
declare -r tfile=$(mktemp)
|
|
||||||
|
|
||||||
if [ $(grep '^\[Profile' "$inifile" | wc -l) == "1" ]; then ### only 1 profile found
|
# tempIni will contain: [ProfileX], Name=, IsRelative= and Path= (and Default= if present) of the only (if) or the selected (else) profile
|
||||||
grep '^\[Profile' -A 4 "$inifile" | grep -v '^\[Profile' > $tfile
|
if [ $(grep -c '^\[Profile' "${inifile}") -eq "1" ]; then ### only 1 profile found
|
||||||
|
tempIni="$(grep '^\[Profile' -A 4 "${inifile}")"
|
||||||
else
|
else
|
||||||
grep -E -v '^\[General\]|^StartWithLastProfile=|^IsRelative=' "$inifile"
|
echo -e "Profiles found:\n––––––––––––––––––––––––––––––"
|
||||||
echo ''
|
## cmd-substitution to strip trailing newlines and in quotes to keep internal ones:
|
||||||
|
echo "$(grep --color=never -E 'Default=[^1]|\[Profile[0-9]*\]|Name=|Path=|^$' "${inifile}")"
|
||||||
|
echo '––––––––––––––––––––––––––––––'
|
||||||
read -p 'Select the profile number ( 0 for Profile0, 1 for Profile1, etc ) : ' -r
|
read -p 'Select the profile number ( 0 for Profile0, 1 for Profile1, etc ) : ' -r
|
||||||
echo -e "\n"
|
echo -e "\n"
|
||||||
if [[ $REPLY =~ ^(0|[1-9][0-9]*)$ ]]; then
|
if [[ $REPLY =~ ^(0|[1-9][0-9]*)$ ]]; then
|
||||||
grep '^\[Profile'${REPLY} -A 4 "$inifile" | grep -v '^\[Profile'${REPLY} > $tfile
|
tempIni="$(grep "^\[Profile${REPLY}" -A 4 "${inifile}")" || {
|
||||||
if [[ "$?" != "0" ]]; then
|
echo -e "${RED}Profile${REPLY} does not exist!${NC}" && exit 1
|
||||||
echo "Profile${REPLY} does not exist!" && exit 1
|
}
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
echo "Invalid selection!" && exit 1
|
echo -e "${RED}Invalid selection!${NC}" && exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -r profpath=$(grep '^Path=' $tfile)
|
# extracting 0 or 1 from the "IsRelative=" line
|
||||||
declare -r pathisrel=$(grep '^IsRelative=' $tfile)
|
declare -r pathisrel=$(sed -n 's/^IsRelative=\([01]\)$/\1/p' <<< "${tempIni}")
|
||||||
|
|
||||||
rm "$tfile"
|
# extracting only the path itself, excluding "Path="
|
||||||
|
PROFILE_PATH=$(sed -n 's/^Path=\(.*\)$/\1/p' <<< "${tempIni}")
|
||||||
# update global variable
|
# update global variable if path is relative
|
||||||
if [[ ${pathisrel#*=} == "1" ]]; then
|
[[ ${pathisrel} == "1" ]] && PROFILE_PATH="$(dirname "${inifile}")/${PROFILE_PATH}"
|
||||||
PROFILE_PATH="$(dirname "$inifile")/${profpath#*=}"
|
|
||||||
else
|
|
||||||
PROFILE_PATH="${profpath#*=}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getProfilePath () {
|
getProfilePath () {
|
||||||
@ -161,16 +157,14 @@ getProfilePath () {
|
|||||||
if [ "$PROFILE_PATH" = false ]; then
|
if [ "$PROFILE_PATH" = false ]; then
|
||||||
PROFILE_PATH="$SCRIPT_DIR"
|
PROFILE_PATH="$SCRIPT_DIR"
|
||||||
elif [ "$PROFILE_PATH" = 'list' ]; then
|
elif [ "$PROFILE_PATH" = 'list' ]; then
|
||||||
local ini=''
|
|
||||||
if [[ -f "$f1" ]]; then
|
if [[ -f "$f1" ]]; then
|
||||||
ini="$f1"
|
readIniFile "$f1" # updates PROFILE_PATH or exits on error
|
||||||
elif [[ -f "$f2" ]]; then
|
elif [[ -f "$f2" ]]; then
|
||||||
ini="$f2"
|
readIniFile "$f2"
|
||||||
else
|
else
|
||||||
echo -e "${RED}Error: Sorry, -l is not supported for your OS${NC}"
|
echo -e "${RED}Error: Sorry, -l is not supported for your OS${NC}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
readIniFile "$ini" # updates PROFILE_PATH or exits on error
|
|
||||||
#else
|
#else
|
||||||
# PROFILE_PATH already set by user with -p
|
# PROFILE_PATH already set by user with -p
|
||||||
fi
|
fi
|
||||||
@ -191,14 +185,12 @@ get_updater_version () {
|
|||||||
# -d: 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
|
||||||
# -u: 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
|
[ $UPDATE = 'no' ] && return 0 # User signified not to check for updates
|
||||||
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
|
[ -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
|
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
|
||||||
@ -208,13 +200,12 @@ update_updater () {
|
|||||||
else
|
else
|
||||||
return 0 # No update available
|
return 0 # No update available
|
||||||
fi
|
fi
|
||||||
mv "${tmpfile}" "${SCRIPT_DIR}/updater.sh"
|
mv "${tmpfile}" "$SCRIPT_FILE"
|
||||||
chmod u+x "${SCRIPT_DIR}/updater.sh"
|
chmod u+x "$SCRIPT_FILE"
|
||||||
"${SCRIPT_DIR}/updater.sh" "$@" -d
|
"$SCRIPT_FILE" "$@" -d
|
||||||
exit 1
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
# Update user.js #
|
# Update user.js #
|
||||||
#########################
|
#########################
|
||||||
@ -250,7 +241,7 @@ 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
|
[ -z "${newfile}" ] && echo -e "${RED}Error! Could not download user.js${NC}" && return 1 # check if download failed
|
||||||
|
|
||||||
echo -e "Please observe the following information:
|
echo -e "Please observe the following information:
|
||||||
@ -370,12 +361,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
|
[ -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
|
||||||
@ -383,7 +374,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
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.1 KiB |
BIN
wikipiki/parseError.png
Normal file
BIN
wikipiki/parseError.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
Reference in New Issue
Block a user