From 844f3ce9c81f12ea1d6b2994f440916ec4bdb4b0 Mon Sep 17 00:00:00 2001 From: Thorin-Oakenpants Date: Fri, 5 Mar 2021 10:15:26 +0000 Subject: [PATCH 1/4] tidy --- scratchpad-scripts/arkenfox-clear-removed.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scratchpad-scripts/arkenfox-clear-removed.js b/scratchpad-scripts/arkenfox-clear-removed.js index 9a89288..20e7305 100644 --- a/scratchpad-scripts/arkenfox-clear-removed.js +++ b/scratchpad-scripts/arkenfox-clear-removed.js @@ -1,7 +1,7 @@ /*** This will reset the preferences that have been removed completely from the arkenfox user.js. - Last updated: 27-Feb-2021 + Last updated: 04-Mar-2021 For instructions see: https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts] @@ -9,7 +9,7 @@ (function() { let ops = [ - /* removed in arkenfox user.js v52-57 */ + /* removed in arkenfox user.js */ /* 52-alpha */ 'browser.search.reset.enabled', 'browser.search.reset.whitelist', @@ -26,7 +26,6 @@ 'extensions.pocket.api', // covered by extensions.pocket.enabled 'extensions.pocket.oAuthConsumerKey', // ditto 'extensions.pocket.site', // ditto - /* 56-alpha: none */ /* 57-alpha */ 'geo.wifi.xhr.timeout', // covered by geo.enabled 'browser.search.geoip.timeout', // ditto From 3430507ae4062761cddf018397364710375c4ae2 Mon Sep 17 00:00:00 2001 From: earthlng Date: Sun, 7 Mar 2021 13:29:33 +0000 Subject: [PATCH 2/4] v3.0 - improve readIniFile() (#1128) - grep -c equals grep | wc -l - make output prettier - work with variable instead of temporary file + a few minor changes/cleanup --- updater.sh | 51 +++++++++++++++++++++------------------------------ 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/updater.sh b/updater.sh index 5f37ebc..e265445 100755 --- a/updater.sh +++ b/updater.sh @@ -2,7 +2,7 @@ ## arkenfox user.js updater for macOS and Linux -## version: 2.9 +## version: 3.0 ## Author: Pat Johnson (@overdodactyl) ## Additional contributors: @earthlng, @ema-pe, @claustromaniac @@ -103,7 +103,6 @@ Optional Arguments: # File Handling # ######################### -# Download files download_file () { # expects URL as argument ($1) declare -r tf=$(mktemp) @@ -122,36 +121,33 @@ open_file () { # expects one argument: file_path readIniFile () { # expects one argument: absolute path of profiles.ini declare -r inifile="$1" - declare -r tfile=$(mktemp) - if [ $(grep '^\[Profile' "$inifile" | wc -l) == "1" ]; then ### only 1 profile found - grep '^\[Profile' -A 4 "$inifile" | grep -v '^\[Profile' > $tfile + # tempIni will contain: [ProfileX], Name=, IsRelative= and Path= (and Default= if present) of the only (if) or the selected (else) profile + if [ $(grep -c '^\[Profile' "${inifile}") -eq "1" ]; then ### only 1 profile found + tempIni="$(grep '^\[Profile' -A 4 "${inifile}")" else - grep -E -v '^\[General\]|^StartWithLastProfile=|^IsRelative=' "$inifile" - echo '' + echo -e "Profiles found:\n––––––––––––––––––––––––––––––" + ## 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 echo -e "\n" if [[ $REPLY =~ ^(0|[1-9][0-9]*)$ ]]; then - grep '^\[Profile'${REPLY} -A 4 "$inifile" | grep -v '^\[Profile'${REPLY} > $tfile - if [[ "$?" != "0" ]]; then - echo "Profile${REPLY} does not exist!" && exit 1 - fi + tempIni="$(grep "^\[Profile${REPLY}" -A 4 "${inifile}")" || { + echo -e "${RED}Profile${REPLY} does not exist!${NC}" && exit 1 + } else - echo "Invalid selection!" && exit 1 + echo -e "${RED}Invalid selection!${NC}" && exit 1 fi fi - declare -r profpath=$(grep '^Path=' $tfile) - declare -r pathisrel=$(grep '^IsRelative=' $tfile) + # extracting 0 or 1 from the "IsRelative=" line + declare -r pathisrel=$(sed -n 's/^IsRelative=\([01]\)$/\1/p' <<< "${tempIni}") - rm "$tfile" - - # update global variable - if [[ ${pathisrel#*=} == "1" ]]; then - PROFILE_PATH="$(dirname "$inifile")/${profpath#*=}" - else - PROFILE_PATH="${profpath#*=}" - fi + # extracting only the path itself, excluding "Path=" + PROFILE_PATH=$(sed -n 's/^Path=\(.*\)$/\1/p' <<< "${tempIni}") + # update global variable if path is relative + [[ ${pathisrel} == "1" ]] && PROFILE_PATH="$(dirname "${inifile}")/${PROFILE_PATH}" } getProfilePath () { @@ -161,16 +157,14 @@ getProfilePath () { if [ "$PROFILE_PATH" = false ]; then PROFILE_PATH="$SCRIPT_DIR" elif [ "$PROFILE_PATH" = 'list' ]; then - local ini='' if [[ -f "$f1" ]]; then - ini="$f1" + readIniFile "$f1" # updates PROFILE_PATH or exits on error elif [[ -f "$f2" ]]; then - ini="$f2" + readIniFile "$f2" else echo -e "${RED}Error: Sorry, -l is not supported for your OS${NC}" exit 1 fi - readIniFile "$ini" # updates PROFILE_PATH or exits on error #else # PROFILE_PATH already set by user with -p fi @@ -191,9 +185,7 @@ get_updater_version () { # -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 + [ $UPDATE = 'no' ] && return 0 # User signified not to check for updates 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 @@ -214,7 +206,6 @@ update_updater () { exit 0 } - ######################### # Update user.js # ######################### From 692ed70ea9f1eddc1a72725df25197a4847110d7 Mon Sep 17 00:00:00 2001 From: Thorin-Oakenpants Date: Mon, 8 Mar 2021 01:49:21 +0000 Subject: [PATCH 3/4] remove maintenance of this comment --- user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user.js b/user.js index 5298948..eee08bd 100644 --- a/user.js +++ b/user.js @@ -38,7 +38,7 @@ - If you are not using arkenfox v78... (not a definitive list) - 1244: HTTPS-Only mode is enabled - 1401: document fonts is inactive as it is now covered by RFP in FF80+ - - 4600: some prefs may apply even if you use RFP (currently none apply as of FF84) + - 4600: some prefs may apply even if you use RFP - 9999: switch the appropriate deprecated section(s) back on * INDEX: From 9138e342fdccfed95c899ac795f8e7a0c6f20b55 Mon Sep 17 00:00:00 2001 From: Thorin-Oakenpants Date: Wed, 10 Mar 2021 00:06:30 +0000 Subject: [PATCH 4/4] misc (#1136) - 0000: remove old XUL info, dropped in FF73+ - 0201: save 3 chars - 0350: add default status for unsubmittedCheck - 0351: change to enforce: has been default false going back to at least FF60, including current Beta/Dev/Nightly - along with 0602 `network.dns.disablePrefetchFromHTTPS` and 0603 `network.predictor.enable-prefetch`, I considered making them inactive, but decided it was good to leave them active for non-stable users just in case they get flipped - 0515: add default status - 0850c: remove info: out of date: doesn't work lilke that anymore and can't be assed figuring it out what with megabar and urlbar2 changes - 0871: make inactive: default false since at least FF60 - no need to enforce for non-stable in case it is flipped. It's a pretty minor shoulder-surfer privacy issue and the previews are small. If you're not sure what this pref does. On false you get one tab shown, on true you get as many as can fit across your screen. I squeezed in 15, and after that it became a list - fixup `***/` - shave off six lines and almost 400 bytes for you bastards --- user.js | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/user.js b/user.js index eee08bd..2eee2e0 100644 --- a/user.js +++ b/user.js @@ -83,9 +83,8 @@ user_pref("_user.js.parrot", "START: Oh yes, the Norwegian Blue... what's wrong with it?"); /* 0000: disable about:config warning - * FF72 or lower: chrome://global/content/config.xul * FF73-86: chrome://global/content/config.xhtml ***/ -user_pref("general.warnOnAboutConfig", false); // XUL/XHTML version +user_pref("general.warnOnAboutConfig", false); // XHTML version user_pref("browser.aboutConfig.showWarning", false); // HTML version [FF71+] /*** [SECTION 0100]: STARTUP ***/ @@ -143,7 +142,7 @@ user_pref("browser.newtabpage.activity-stream.default.sites", ""); user_pref("_user.js.parrot", "0200 syntax error: the parrot's definitely deceased!"); /** GEOLOCATION ***/ /* 0201: disable Location-Aware Browsing - * [NOTE] Best left at default "true", fingerprintable, is already behind a prompt (see 0202) + * [NOTE] Best left at default "true", fingerprintable, already behind a prompt (see 0202) * [1] https://www.mozilla.org/firefox/geolocation/ ***/ // user_pref("geo.enabled", false); /* 0202: set a default permission for Location (see 0201) [FF58+] @@ -251,10 +250,10 @@ user_pref("browser.discovery.enabled", false); /* 0350: disable Crash Reports ***/ user_pref("breakpad.reportURL", ""); user_pref("browser.tabs.crashReporting.sendReport", false); // [FF44+] -user_pref("browser.crashReports.unsubmittedCheck.enabled", false); // [FF51+] -/* 0351: disable backlogged Crash Reports +user_pref("browser.crashReports.unsubmittedCheck.enabled", false); // [FF51+] [DEFAULT: false except Nightly] +/* 0351: enforce no submission of backlogged Crash Reports [FF58+] * [SETTING] Privacy & Security>Firefox Data Collection & Use>Allow Firefox to send backlogged crash reports ***/ -user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); // [FF58+] +user_pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); // [DEFAULT: false] /* 0390: disable Captive Portal detection * [1] https://www.eff.org/deeplinks/2017/08/how-captive-portals-interfere-wireless-security-and-privacy * [2] https://wiki.mozilla.org/Necko/CaptivePortal ***/ @@ -352,7 +351,7 @@ user_pref("extensions.formautofill.creditCards.enabled", false); // [FF56+] user_pref("extensions.formautofill.heuristics.enabled", false); // [FF55+] /* 0518: disable Web Compatibility Reporter [FF56+] * Web Compatibility Reporter adds a "Report Site Issue" button to send data to Mozilla ***/ -user_pref("extensions.webcompat-reporter.enabled", false); +user_pref("extensions.webcompat-reporter.enabled", false); // [DEFAULT: false in stable] /*** [SECTION 0600]: BLOCK IMPLICIT OUTBOUND [not explicitly asked for - e.g. clicked on] ***/ user_pref("_user.js.parrot", "0600 syntax error: the parrot's no more!"); @@ -492,12 +491,7 @@ user_pref("browser.urlbar.dnsResolveSingleWordsAfterSearch", 0); * [SETTING] Privacy & Security>Address Bar>When using the address bar, suggest>Search engines ***/ // user_pref("browser.urlbar.suggest.engines", false); /* 0850c: disable location bar dropdown - * This value controls the total number of entries to appear in the location bar dropdown - * [NOTE] Items (bookmarks/history/openpages) with a high "frecency"/"bonus" will always - * be displayed (no we do not know how these are calculated or what the threshold is), - * and this does not affect the search by search engine suggestion (see 0807) - * [NOTE] This setting is only useful if you want to enable search engine keywords - * (i.e. at least one of 0850a suggestion types must be true) but you want to *limit* suggestions shown ***/ + * This value controls the total number of entries to appear in the location bar dropdown ***/ // user_pref("browser.urlbar.maxRichResults", 0); /* 0850d: disable location bar autofill * [1] https://support.mozilla.org/en-US/kb/address-bar-autocomplete-firefox#w_url-autocomplete ***/ @@ -519,7 +513,7 @@ user_pref("browser.taskbar.lists.frequent.enabled", false); user_pref("browser.taskbar.lists.recent.enabled", false); user_pref("browser.taskbar.lists.tasks.enabled", false); /* 0871: disable Windows taskbar preview [WINDOWS] ***/ -user_pref("browser.taskbar.previews.enable", false); + // user_pref("browser.taskbar.previews.enable", false); // [DEFAULT: false] /*** [SECTION 0900]: PASSWORDS ***/ user_pref("_user.js.parrot", "0900 syntax error: the parrot's expired!"); @@ -653,7 +647,7 @@ user_pref("security.ssl.require_safe_negotiation", true); * [1] https://www.ssllabs.com/ssl-pulse/ ***/ // user_pref("security.tls.version.min", 3); // [DEFAULT: 3] // user_pref("security.tls.version.max", 4); -/* 1203: enforce TLS 1.0 and 1.1 downgrades as session only */ +/* 1203: enforce TLS 1.0 and 1.1 downgrades as session only ***/ user_pref("security.tls.version.enable-deprecated", false); /* 1204: disable SSL session tracking [FF36+] * SSL Session IDs are unique and last up to 24hrs in Firefox (or longer with prolongation attacks) @@ -897,7 +891,7 @@ user_pref("plugin.state.flash", 0); * [1] https://wiki.mozilla.org/GeckoMediaPlugins ***/ // user_pref("media.gmp-provider.enabled", false); /* 1825: disable widevine CDM (Content Decryption Module) - * [NOTE] This is covered by the EME master switch (1830) **/ + * [NOTE] This is covered by the EME master switch (1830) ***/ // user_pref("media.gmp-widevinecdm.enabled", false); /* 1830: disable all DRM content (EME: Encryption Media Extension) * [SETUP-WEB] e.g. Netflix, Amazon Prime, Hulu, HBO, Disney+, Showtime, Starz, DirectTV @@ -1033,7 +1027,7 @@ user_pref("_user.js.parrot", "2400 syntax error: the parrot's kicked the bucket! * This applies to onCut/onCopy/onPaste events - i.e. it requires interaction with the website * [WARNING] If both 'middlemouse.paste' and 'general.autoScroll' are true (at least one * is default false) then enabling this pref can leak clipboard content [1] - * [1] https://bugzilla.mozilla.org/1528289 */ + * [1] https://bugzilla.mozilla.org/1528289 ***/ // user_pref("dom.event.clipboardevents.enabled", false); /* 2404: disable clipboard commands (cut/copy) from "non-privileged" content [FF41+] * this disables document.execCommand("cut"/"copy") to protect your clipboard @@ -1187,7 +1181,7 @@ user_pref("browser.display.use_system_colors", false); // [DEFAULT: false] * Currently applies to cross-origin geolocation, camera, mic and screen-sharing * permissions, and fullscreen requests. Disabling delegation means any prompts * for these will show/use their correct 3rd party origin - * [1] https://groups.google.com/forum/#!topic/mozilla.dev.platform/BdFOMAuCGW8/discussion */ + * [1] https://groups.google.com/forum/#!topic/mozilla.dev.platform/BdFOMAuCGW8/discussion ***/ user_pref("permissions.delegation.enabled", false); /* 2624: enable "window.name" protection [FF82+] * If a new page from another domain is loaded into a tab, then window.name is set to an empty string. The original