mirror of
https://github.com/arkenfox/user.js.git
synced 2025-09-01 09:28:31 +02:00
Compare commits
154 Commits
Author | SHA1 | Date | |
---|---|---|---|
b9100488cb | |||
9d78e050ee | |||
b07cf1f03d | |||
683ef63b37 | |||
05580f5e99 | |||
ecc62554e5 | |||
f6e6de8444 | |||
f69d92e6dd | |||
3edc48da56 | |||
868882ae33 | |||
ff9bf76e52 | |||
4bc5b89cfe | |||
bb1e5bfd54 | |||
27d72eda9e | |||
07117c65c1 | |||
919d4bfe96 | |||
e38e253c25 | |||
14aaec71fb | |||
c0780df24d | |||
0ea1605642 | |||
bd384622db | |||
3366e0aa16 | |||
dff5bb478a | |||
d455c500a6 | |||
b90e72370c | |||
dd162d9f48 | |||
d7c276b3fe | |||
394b691599 | |||
ba83c555cc | |||
b695468c7e | |||
deae6e14f9 | |||
97c5378e52 | |||
d2dd0c2ab4 | |||
8c7149c6a5 | |||
d2da48c215 | |||
7e71b6663c | |||
94c83519f2 | |||
e7d20867cb | |||
55ae994972 | |||
f0945743b7 | |||
ee35d7c70d | |||
fe1b03bd2a | |||
187692af66 | |||
b6e2a3f64f | |||
6f7e09ad43 | |||
4ddf60cf32 | |||
24777c9ac2 | |||
615ebeda2f | |||
4139630635 | |||
a542701ba5 | |||
e67a0c868d | |||
1afd52de6e | |||
64f34f1471 | |||
5f3e3b2691 | |||
1ce1f74494 | |||
03f558b09c | |||
cd9fc110b0 | |||
7619e312de | |||
5d2c5de11c | |||
e1022c2e72 | |||
e431b324c8 | |||
18ad40a5c6 | |||
315de066ec | |||
85273d0f19 | |||
ef293b57a7 | |||
79d316fd22 | |||
ed60588473 | |||
07c128a190 | |||
5b1d56933b | |||
34cfcedc1b | |||
f9146fdf24 | |||
a1cdbc8324 | |||
cd07641a9d | |||
9c02949e04 | |||
1ef62a1036 | |||
5672bc8cc8 | |||
df1732745d | |||
30daf8640c | |||
4074a37e1d | |||
97043b0ce1 | |||
42ea484017 | |||
3f6340b69c | |||
884e84a4cb | |||
560acfc94f | |||
fb263f5624 | |||
19b392b83d | |||
2db76c95c3 | |||
b6fbf77dde | |||
a4ba22e912 | |||
163e18ce6d | |||
a13027905e | |||
8f76d9439f | |||
f0980b5cb8 | |||
450c9a9e0f | |||
6acfdaccbd | |||
a0e0a2a6c9 | |||
f67e729197 | |||
19526b573c | |||
b0221ec838 | |||
a3611b7cf8 | |||
bff1e84afa | |||
1d31da40ec | |||
0d57cfc44a | |||
0cfb2fb06d | |||
d5f297ed42 | |||
c13dbdf40d | |||
6173104a9e | |||
0c79b8b45b | |||
895f8d01d5 | |||
65dfad5c76 | |||
fdaf22780f | |||
16756646bb | |||
e4f80225d8 | |||
67eec9c85c | |||
539750d2f2 | |||
d91226ed55 | |||
301fcd059d | |||
1cc9a08a18 | |||
5d1857ddd8 | |||
226af6f679 | |||
7f2c92f654 | |||
5b82afd5bd | |||
d7b1877a1f | |||
1b6239eab8 | |||
ad0187122d | |||
624e50faac | |||
a9e9392172 | |||
201210111e | |||
53f8578749 | |||
dc4d9e4dae | |||
e1b0eae740 | |||
be0ccf6460 | |||
7c0a327b06 | |||
a35cba3914 | |||
e16425310f | |||
d503d96db0 | |||
335299a0cf | |||
7311cfdf84 | |||
3a9440aeea | |||
3210ab0ca8 | |||
2c734612f6 | |||
a12dd83b1f | |||
44d9ceaf05 | |||
be9d9ac9ca | |||
66cdb72927 | |||
953b96431e | |||
4d72ad90b0 | |||
cccb5b10b4 | |||
810045eb39 | |||
b47982bb9a | |||
0691b8babe | |||
8d1c95c650 | |||
19484e1a56 | |||
755ebf88fb |
@ -8,11 +8,11 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
Before you proceed...
|
Before you proceed...
|
||||||
- Keep reading this. Seriously.
|
- Issues will be closed as invalid if you do not [troubleshoot](https://github.com/ghacksuserjs/ghacks-user.js/wiki/1.4-Troubleshooting), including
|
||||||
- Note that we do not support forks (i.e. IceCat, Pale Moon, WaterFox, etc).
|
- confirming the problem is caused by the `user.js`
|
||||||
- Make sure you searched for 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.
|
||||||
- Check out our [troubleshooting](https://github.com/ghacksuserjs/ghacks-user.js/wiki/1.4-Troubleshooting) wiki page, including steps to see if the problem is caused by the `user.js` or an extension.
|
- Note: We do not support forks
|
||||||
|
|
||||||
See also:
|
See also:
|
||||||
- Extension breakage due to prefs [issue 391](https://github.com/ghacksuserjs/ghacks-user.js/issues/391)
|
- Extension breakage due to prefs [issue 391](https://github.com/ghacksuserjs/ghacks-user.js/issues/391)
|
||||||
|
@ -8,7 +8,7 @@ Everyone, experts included, should at least read the [implementation](https://gi
|
|||||||
|
|
||||||
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 Firefox. Using it as-is in other Gecko-based browsers can be counterproductive, especially in the Tor Browser.
|
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.
|
||||||
|
|
||||||
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: [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)
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ Literally thousands of sources, references and suggestions. That said...
|
|||||||
* Martin Brinkmann at [ghacks](https://www.ghacks.net/) <sup>1</sup>
|
* Martin Brinkmann at [ghacks](https://www.ghacks.net/) <sup>1</sup>
|
||||||
* The ghacks community and commentators
|
* The ghacks community and commentators
|
||||||
* [12bytes](https://12bytes.org/articles/tech/firefox/firefoxgecko-configuration-guide-for-privacy-and-performance-buffs)
|
* [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 [GitLab](https://gitlab.com/labwrat/Firefox-user.js/tree/master)
|
* The 12bytes article now uses this user.js and supplements it with an additional JS hosted at [Codeberg](https://codeberg.org/12bytes.org/Firefox-user.js-supplement)
|
||||||
|
|
||||||
<sup>1</sup> The ghacks user.js was an independent project by [Thorin-Oakenpants](https://github.com/Thorin-Oakenpants) started in early 2015 and was [first published](https://www.ghacks.net/2015/08/18/a-comprehensive-list-of-firefox-privacy-and-security-settings/) at ghacks in August 2015. With Martin Brinkmann's blessing, it will keep the ghacks name.
|
<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.
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## prefs.js cleaner for Linux/Mac
|
## prefs.js cleaner for Linux/Mac
|
||||||
## author: @claustromaniac
|
## author: @claustromaniac
|
||||||
## version: 1.1
|
## version: 1.2
|
||||||
|
|
||||||
## 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
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ fQuit() {
|
|||||||
fFF_check() {
|
fFF_check() {
|
||||||
# there are many ways to see if firefox is running or not, some more reliable than others
|
# there are many ways to see if firefox is running or not, some more reliable than others
|
||||||
# this isn't elegant and might not be future-proof but should at least be compatible with any environment
|
# this isn't elegant and might not be future-proof but should at least be compatible with any environment
|
||||||
while [ -e webappsstore.sqlite-shm ]; do
|
while [ -e lock ]; do
|
||||||
echo -e "\nThis Firefox profile seems to be in use. Close Firefox and try again.\n"
|
echo -e "\nThis Firefox profile seems to be in use. Close Firefox and try again.\n"
|
||||||
read -p "Press any key to continue."
|
read -p "Press any key to continue."
|
||||||
done
|
done
|
||||||
@ -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.1 ║"
|
echo " ║ v1.2 ║"
|
||||||
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."
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/***
|
/***
|
||||||
This will reset the preferences that are under sections 4600 & 4700 in the ghacks user.js
|
This will reset the preferences that are under sections 4600 & 4700 in the ghacks user.js
|
||||||
up to and including release 60-beta. These are the prefs that are no longer necessary,
|
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.
|
or they conflict with, privacy.resistFingerprinting if you have that enabled.
|
||||||
|
|
||||||
For instructions see:
|
For instructions see:
|
||||||
@ -22,6 +22,8 @@
|
|||||||
'dom.w3c_touch_events.enabled',
|
'dom.w3c_touch_events.enabled',
|
||||||
'media.ondevicechange.enabled',
|
'media.ondevicechange.enabled',
|
||||||
'webgl.enable-debug-renderer-info',
|
'webgl.enable-debug-renderer-info',
|
||||||
|
'dom.w3c_pointer_events.enabled',
|
||||||
|
'ui.use_standins_for_native_colors',
|
||||||
/* section 4700 */
|
/* section 4700 */
|
||||||
'general.useragent.override',
|
'general.useragent.override',
|
||||||
'general.buildID.override',
|
'general.buildID.override',
|
@ -1,6 +1,6 @@
|
|||||||
/***
|
/***
|
||||||
This will reset the preferences that have been deprecated by Mozilla
|
This will reset the preferences that have been deprecated by Mozilla
|
||||||
and used in the ghacks user.js up to and including release 60-beta
|
and used in the ghacks user.js up to and including Firefox/ESR 68
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@ -12,8 +12,43 @@
|
|||||||
let ops = [
|
let ops = [
|
||||||
/* deprecated */
|
/* deprecated */
|
||||||
|
|
||||||
/* ESR52.x users can remove sections 53-60 but it is not
|
/* 68 */
|
||||||
crucial as your user.js will reinstate them */
|
'browser.newtabpage.activity-stream.disableSnippets',
|
||||||
|
'browser.aboutHomeSnippets.updateUrl',
|
||||||
|
'lightweightThemes.update.enabled',
|
||||||
|
'security.csp.experimentalEnabled',
|
||||||
|
/* F67 */
|
||||||
|
'dom.event.highrestimestamp.enabled',
|
||||||
|
'browser.newtabpage.activity-stream.asrouter.userprefs.cfr',
|
||||||
|
/* 66 */
|
||||||
|
'browser.chrome.errorReporter.enabled',
|
||||||
|
'browser.chrome.errorReporter.submitUrl',
|
||||||
|
'network.allow-experiments',
|
||||||
|
/* 65 */
|
||||||
|
'browser.urlbar.autocomplete.enabled',
|
||||||
|
'browser.fixup.hide_user_pass',
|
||||||
|
/* 64 */
|
||||||
|
'browser.onboarding.enabled',
|
||||||
|
'devtools.webide.autoinstallADBHelper',
|
||||||
|
'devtools.webide.adbAddonURL',
|
||||||
|
'security.csp.enable_violation_events',
|
||||||
|
/* 63 */
|
||||||
|
'browser.search.countryCode',
|
||||||
|
'app.update.enabled',
|
||||||
|
'shield.savant.enabled',
|
||||||
|
'browser.chrome.favicons',
|
||||||
|
'media.autoplay.enabled',
|
||||||
|
'network.cookie.lifetime.days',
|
||||||
|
'browser.ctrlTab.previews',
|
||||||
|
/* 62 */
|
||||||
|
'plugin.state.java',
|
||||||
|
/* 61 */
|
||||||
|
'experiments.enabled',
|
||||||
|
'experiments.manifest.uri',
|
||||||
|
'experiments.supported',
|
||||||
|
'experiments.activeExperiment',
|
||||||
|
'network.jar.block-remote-files',
|
||||||
|
'network.jar.open-unsafe-types',
|
||||||
/* 60 */
|
/* 60 */
|
||||||
'browser.newtabpage.directory.source',
|
'browser.newtabpage.directory.source',
|
||||||
'browser.newtabpage.enhanced',
|
'browser.newtabpage.enhanced',
|
||||||
@ -22,7 +57,6 @@
|
|||||||
'extensions.shield-recipe-client.api_url',
|
'extensions.shield-recipe-client.api_url',
|
||||||
'browser.newtabpage.activity-stream.enabled',
|
'browser.newtabpage.activity-stream.enabled',
|
||||||
'dom.workers.enabled',
|
'dom.workers.enabled',
|
||||||
'view_source.tab',
|
|
||||||
/* 59 */
|
/* 59 */
|
||||||
'intl.locale.matchOS',
|
'intl.locale.matchOS',
|
||||||
'general.useragent.locale',
|
'general.useragent.locale',
|
||||||
@ -76,8 +110,6 @@
|
|||||||
'plugin.scan.WindowsMediaPlayer',
|
'plugin.scan.WindowsMediaPlayer',
|
||||||
'media.getusermedia.screensharing.allow_on_old_platforms',
|
'media.getusermedia.screensharing.allow_on_old_platforms',
|
||||||
'dom.beforeAfterKeyboardEvent.enabled',
|
'dom.beforeAfterKeyboardEvent.enabled',
|
||||||
/* End of ESR52.x section */
|
|
||||||
|
|
||||||
/* 52 */
|
/* 52 */
|
||||||
'network.http.sendSecureXSiteReferrer',
|
'network.http.sendSecureXSiteReferrer',
|
||||||
'media.gmp-eme-adobe.enabled',
|
'media.gmp-eme-adobe.enabled',
|
@ -1,7 +1,7 @@
|
|||||||
/***
|
/***
|
||||||
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 ghacks user.js.
|
||||||
|
|
||||||
Last updated: 16-July-2019
|
Last updated: 12-April-2020
|
||||||
|
|
||||||
For instructions see:
|
For instructions see:
|
||||||
https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts]
|
https://github.com/ghacksuserjs/ghacks-user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts]
|
||||||
@ -168,14 +168,9 @@
|
|||||||
'signon.storeWhenAutocompleteOff',
|
'signon.storeWhenAutocompleteOff',
|
||||||
'xpinstall.whitelist.required',
|
'xpinstall.whitelist.required',
|
||||||
/* 67-beta: Blocklist, SB & TP cleanup: these were all inactive */
|
/* 67-beta: Blocklist, SB & TP cleanup: these were all inactive */
|
||||||
'browser.safebrowsing.downloads.enabled',
|
|
||||||
'browser.safebrowsing.downloads.remote.block_dangerous',
|
'browser.safebrowsing.downloads.remote.block_dangerous',
|
||||||
'browser.safebrowsing.downloads.remote.block_dangerous_host',
|
'browser.safebrowsing.downloads.remote.block_dangerous_host',
|
||||||
'browser.safebrowsing.downloads.remote.block_potentially_unwanted',
|
|
||||||
'browser.safebrowsing.downloads.remote.block_uncommon',
|
|
||||||
'browser.safebrowsing.blockedURIs.enabled',
|
'browser.safebrowsing.blockedURIs.enabled',
|
||||||
'browser.safebrowsing.malware.enabled',
|
|
||||||
'browser.safebrowsing.phishing.enabled',
|
|
||||||
'browser.safebrowsing.provider.google.gethashURL',
|
'browser.safebrowsing.provider.google.gethashURL',
|
||||||
'browser.safebrowsing.provider.google.updateURL',
|
'browser.safebrowsing.provider.google.updateURL',
|
||||||
'browser.safebrowsing.provider.google4.gethashURL',
|
'browser.safebrowsing.provider.google4.gethashURL',
|
||||||
@ -204,6 +199,28 @@
|
|||||||
'font.name.serif.x-western',
|
'font.name.serif.x-western',
|
||||||
'layout.css.font-loading-api.enabled',
|
'layout.css.font-loading-api.enabled',
|
||||||
'toolkit.telemetry.cachedClientID',
|
'toolkit.telemetry.cachedClientID',
|
||||||
|
/* 69-beta */
|
||||||
|
'plugin.sessionPermissionNow.intervalInMinutes',
|
||||||
|
/* 70-beta */
|
||||||
|
'browser.cache.disk_cache_ssl',
|
||||||
|
'browser.sessionhistory.max_entries',
|
||||||
|
'dom.push.connection.enabled',
|
||||||
|
'dom.push.serverURL',
|
||||||
|
'extensions.getAddons.discovery.api_url',
|
||||||
|
'extensions.htmlaboutaddons.discover.enabled',
|
||||||
|
'extensions.webservice.discoverURL',
|
||||||
|
'intl.locale.requested',
|
||||||
|
'intl.regional_prefs.use_os_locales',
|
||||||
|
'privacy.usercontext.about_newtab_segregation.enabled',
|
||||||
|
'security.insecure_connection_icon.pbmode.enabled',
|
||||||
|
'security.insecure_connection_text.pbmode.enabled',
|
||||||
|
'webgl.dxgl.enabled',
|
||||||
|
/* 71-beta */
|
||||||
|
'media.block-autoplay-until-in-foreground',
|
||||||
|
'middlemouse.paste',
|
||||||
|
/* 75-beta */
|
||||||
|
'browser.search.geoip.url',
|
||||||
|
'browser.search.region',
|
||||||
/* 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,65 +1,11 @@
|
|||||||
|
|
||||||
/*** ghacks-user.js troubleshooter.js v1.5.2 ***/
|
/*** ghacks-user.js troubleshooter.js v1.6.1 ***/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
if("undefined" === typeof(Services)) {
|
if ("undefined" === typeof(Services)) return alert('about:config needs to be the active tab!');
|
||||||
alert("about:config needs to be the active tab!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMyList(arr) {
|
const aPREFS = [
|
||||||
let aRet = [];
|
|
||||||
let dummy = 0;
|
|
||||||
for (let i = 0, len = arr.length; i < len; i++) {
|
|
||||||
if (Services.prefs.prefHasUserValue(arr[i])) {
|
|
||||||
dummy = Services.prefs.getPrefType(arr[i]);
|
|
||||||
switch (dummy) {
|
|
||||||
case 32: // string (see https://dxr.mozilla.org/mozilla-central/source/modules/libpref/nsIPrefBranch.idl#31)
|
|
||||||
dummy = Services.prefs.getCharPref(arr[i]);
|
|
||||||
aRet.push({'name':arr[i],'value': dummy,'type':32});
|
|
||||||
break;
|
|
||||||
case 64: // int
|
|
||||||
dummy = Services.prefs.getIntPref(arr[i]);
|
|
||||||
aRet.push({'name':arr[i],'value': dummy,'type':64});
|
|
||||||
break;
|
|
||||||
case 128: // boolean
|
|
||||||
dummy = Services.prefs.getBoolPref(arr[i]);
|
|
||||||
aRet.push({'name':arr[i],'value': dummy,'type':128});
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log("error detecting pref-type for '"+arr[i]+"' !");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return aRet;
|
|
||||||
}
|
|
||||||
|
|
||||||
function reapply(arr) {
|
|
||||||
for (let i = 0, len = arr.length; i < len; i++) {
|
|
||||||
switch (arr[i].type) {
|
|
||||||
case 32: // string
|
|
||||||
Services.prefs.setCharPref(arr[i].name, arr[i].value);
|
|
||||||
break;
|
|
||||||
case 64: // int
|
|
||||||
Services.prefs.setIntPref(arr[i].name, arr[i].value);
|
|
||||||
break;
|
|
||||||
case 128: // boolean
|
|
||||||
Services.prefs.setBoolPref(arr[i].name, arr[i].value);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log("error re-appyling value for '"+arr[i].name+"' !"); // should never happen
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function myreset(arr) {
|
|
||||||
for (let i = 0, len = arr.length; i < len; i++) {
|
|
||||||
Services.prefs.clearUserPref(arr[i].name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let ops = [
|
|
||||||
|
|
||||||
/* known culprits */
|
/* known culprits */
|
||||||
'network.cookie.cookieBehavior',
|
'network.cookie.cookieBehavior',
|
||||||
@ -160,56 +106,108 @@
|
|||||||
'last.one.without.comma'
|
'last.one.without.comma'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
// any runtime-set pref that everyone will have and that can be safely reset
|
||||||
|
const oFILLER = { type: 64, name: 'app.update.lastUpdateTime.browser-cleanup-thumbnails', value: 1580000000 };
|
||||||
|
|
||||||
// reset prefs that set the same value as FFs default value
|
function getMyList(arr) {
|
||||||
let aTEMP = getMyList(ops);
|
const aRet = [];
|
||||||
myreset(aTEMP);
|
for (const sPname of arr) {
|
||||||
reapply(aTEMP);
|
if (Services.prefs.prefHasUserValue(sPname)) {
|
||||||
|
const ptype = Services.prefs.getPrefType(sPname);
|
||||||
|
switch (ptype) {
|
||||||
|
case 32: // string (see https://dxr.mozilla.org/mozilla-central/source/modules/libpref/nsIPrefBranch.idl#31)
|
||||||
|
aRet.push({'type':ptype,'name':sPname,'value':Services.prefs.getCharPref(sPname)});
|
||||||
|
break;
|
||||||
|
case 64: // int
|
||||||
|
aRet.push({'type':ptype,'name':sPname,'value':Services.prefs.getIntPref(sPname)});
|
||||||
|
break;
|
||||||
|
case 128: // boolean
|
||||||
|
aRet.push({'type':ptype,'name':sPname,'value':Services.prefs.getBoolPref(sPname)});
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log("error detecting pref-type for '"+sPname+"' !");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return aRet;
|
||||||
|
}
|
||||||
|
|
||||||
const aBACKUP = getMyList(ops);
|
function reapply(arr) {
|
||||||
//console.log(aBACKUP.length, "user-set prefs from our list detected and their values stored.");
|
for (const oPref of arr) {
|
||||||
|
switch (oPref.type) {
|
||||||
|
case 32: // string
|
||||||
|
Services.prefs.setCharPref(oPref.name, oPref.value);
|
||||||
|
break;
|
||||||
|
case 64: // int
|
||||||
|
Services.prefs.setIntPref(oPref.name, oPref.value);
|
||||||
|
break;
|
||||||
|
case 128: // boolean
|
||||||
|
Services.prefs.setBoolPref(oPref.name, oPref.value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log("error re-appyling value for '"+oPref.name+"' !"); // should never happen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let myArr = aBACKUP;
|
function myreset(arr) {
|
||||||
let found = false;
|
for (const oPref of arr) Services.prefs.clearUserPref(oPref.name);
|
||||||
let aDbg = [];
|
}
|
||||||
focus();
|
|
||||||
myreset(aBACKUP); // reset all detected prefs
|
function resetAllMatchingDefault(arr) {
|
||||||
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.")) {
|
const aTmp = getMyList(arr);
|
||||||
aDbg = myArr;
|
myreset(aTmp);
|
||||||
reapply(aBACKUP);
|
reapply(aTmp);
|
||||||
myreset(myArr.slice(0, parseInt(myArr.length/2)));
|
}
|
||||||
while (myArr.length >= 2) {
|
|
||||||
|
function _main(aALL) {
|
||||||
|
const _h = (arr) => Math.ceil(arr.length/2);
|
||||||
|
|
||||||
|
let aTmp = aALL, aDbg = aALL;
|
||||||
|
reapply(aALL);
|
||||||
|
myreset(aTmp.slice(0, _h(aTmp)));
|
||||||
|
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.")) {
|
||||||
myArr = myArr.slice(parseInt(myArr.length/2));
|
aTmp = aTmp.slice(_h(aTmp));
|
||||||
if (myArr.length == 1) {
|
|
||||||
alert("The problem is caused by more than 1 pref !\n\nNarrowed it down to "+ aDbg.length.toString() +" prefs, check the console ...");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
myArr = myArr.slice(0, parseInt(myArr.length/2));
|
aTmp = aTmp.slice(0, _h(aTmp));
|
||||||
aDbg = myArr;
|
aDbg = aTmp; // update narrowed down list
|
||||||
if (myArr.length == 1) { found = true; break; }
|
if (aDbg.length == 1) break;
|
||||||
}
|
}
|
||||||
reapply(aBACKUP);
|
reapply(aALL);
|
||||||
myreset(myArr.slice(0, parseInt(myArr.length/2))); // reset half of the remaining prefs
|
myreset(aTmp.slice(0, _h(aTmp))); // reset half of the remaining prefs
|
||||||
}
|
}
|
||||||
reapply(aBACKUP);
|
reapply(aALL);
|
||||||
|
|
||||||
|
if (aDbg.length == 1) return alert("narrowed it down to:\n\n"+aDbg[0].name+"\n");
|
||||||
|
if (aDbg.length == aALL.length) {
|
||||||
|
let msg = "Failed to narrow it down beyond the initial "+aALL.length+" prefs. The problem is most likely caused by at least 2 prefs!\n\n";
|
||||||
|
msg += "Either those prefs are too far apart in the list or there are exactly 2 culprits and they just happen to be at the wrong place.\n\n";
|
||||||
|
msg += "In case it's the latter, the script can add a dummy pref and you can try again - Try again?";
|
||||||
|
if (confirm(msg)) return _main([...aALL, oFILLER]);
|
||||||
|
} else if (aDbg.length > 10 && confirm("Narrowed it down to "+aDbg.length+" prefs. Try narrowing it down further?")) {
|
||||||
|
return _main(aDbg.reverse());
|
||||||
|
}
|
||||||
|
|
||||||
|
alert("Narrowed it down to "+ aDbg.length.toString() +" prefs, check the console ...");
|
||||||
|
console.log("The problem is caused by 2 or more of these prefs:");
|
||||||
|
for (const oPref of aDbg) console.log(oPref.name);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
reapply(aBACKUP);
|
|
||||||
|
resetAllMatchingDefault(aPREFS); // reset user-set prefs matching FFs default value
|
||||||
|
|
||||||
|
const aBAK = getMyList(aPREFS);
|
||||||
|
//console.log(aBAK.length, "user-set prefs from our list detected and their values stored.");
|
||||||
|
|
||||||
|
focus();
|
||||||
|
myreset(aBAK);
|
||||||
|
if (!confirm("all detected prefs reset.\n\n!! KEEP THIS PROMPT OPEN AND TEST THE SITE IN ANOTHER TAB !!\n\nIF the problem still exists, this script can't help you - click cancel to re-apply your values and exit.\n\nClick OK if your problem is fixed.")) {
|
||||||
|
reapply(aBAK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found) {
|
_main(aBAK);
|
||||||
alert("narrowed it down to:\n\n"+myArr[0].name+"\n");
|
|
||||||
myreset(myArr); // reset the culprit
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log("the problem is caused by a combination of the following prefs:");
|
|
||||||
for (let i = 0, len = aDbg.length; i < len; i++) {
|
|
||||||
console.log(aDbg[i].name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## ghacks-user.js updater for macOS and Linux
|
## ghacks-user.js updater for macOS and Linux
|
||||||
|
|
||||||
## version: 2.5
|
## version: 2.6
|
||||||
## Author: Pat Johnson (@overdodactyl)
|
## Author: Pat Johnson (@overdodactyl)
|
||||||
## Additional contributors: @earthlng, @ema-pe, @claustromaniac
|
## Additional contributors: @earthlng, @ema-pe, @claustromaniac
|
||||||
|
|
||||||
@ -313,8 +313,10 @@ update_userjs () {
|
|||||||
|
|
||||||
# apply overrides
|
# apply overrides
|
||||||
if [ "$SKIPOVERRIDE" = false ]; then
|
if [ "$SKIPOVERRIDE" = false ]; then
|
||||||
while IFS=',' read -ra FILE; do
|
while IFS=',' read -ra FILES; do
|
||||||
add_override "$FILE"
|
for FILE in "${FILES[@]}"; do
|
||||||
|
add_override "$FILE"
|
||||||
|
done
|
||||||
done <<< "$OVERRIDE"
|
done <<< "$OVERRIDE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user