Fix typos, reformat code, and improve readability

This commit is contained in:
Kazevic 2024-07-06 00:41:27 -03:00
parent 23caf69614
commit 1f93e110fb
8 changed files with 690 additions and 653 deletions

View File

@ -9,7 +9,7 @@ assignees: ''
<!--
Please specify:
- the name of the file (i.e. updater.bat, updater.sh)
- the name of the file (i.e., updater.bat, updater.sh)
- steps to reproduce the issue
- actual result
- expected result

View File

@ -9,23 +9,25 @@ assignees: ''
<!--
Issues will be closed as invalid if you do not troubleshoot first, or if you ignore the required info in the template.
Issues will be closed as invalid if you don't troubleshoot first, or if you ignore the required info in the template.
We do not support forks or no-longer supported releases.
We don't support forks or no-longer supported releases.
-->
🟥 https://github.com/arkenfox/user.js/wiki/5.2-Troubleshooting
- [ ] I have read the troubleshooting guide, done the checks and confirmed this is caused by arkenfox
- _unchecked issues ~~may~~ will be closed as invalid_
- [ ] I've read the troubleshooting guide, done the checks and confirmed this is caused by arkenfox
- _unchecked issues ~~may~~ will be closed as invalid_
🟪 REQUIRED INFO
- Browser version & OS:
- Steps to Reproduce (STR):
- Expected result:
- Actual result:
- Console errors and warnings:
- Anything else you deem worth mentioning:
- Browser version & OS:
- Steps to Reproduce (STR):
- Expected result:
- Actual result:
- Console errors and warnings:
- Anything else you deem worth mentioning:
---

View File

@ -7,9 +7,15 @@ 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 don't 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/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.
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.

View File

@ -1,26 +1,36 @@
### 🟪 user.js
A `user.js` is a configuration file that can control Firefox settings - for a more technical breakdown and explanation, you can read more in the [wiki](https://github.com/arkenfox/user.js/wiki/2.1-User.js)
### 🟪 user.js
### 🟩 the arkenfox user.js
A `user.js` is a configuration file that can control Firefox settings—for a more technical breakdown and explanation,
you can read more in the [wiki](https://github.com/arkenfox/user.js/wiki/2.1-User.js).
### 🟩 the arkenfox user.js
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
The `arkenfox user.js` is a **template** which aims to provide as much privacy and enhanced security as possible, and to reduce tracking and fingerprinting as much as possible - while minimizing any loss of functionality and breakage (but it will happen).
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 [wiki](https://github.com/arkenfox/user.js/wiki), as it contains important information regarding a few `user.js` settings. There is also an [interactive current release](https://arkenfox.github.io/gui/), thanks to [icpantsparti2](https://github.com/icpantsparti2).
Everyone, experts included, should at least read the [wiki](https://github.com/arkenfox/user.js/wiki), as it contains
important information regarding a few `user.js` settings. There is also an
[interactive current release](https://arkenfox.github.io/gui/), thanks to [icpantsparti2](https://github.com/icpantsparti2).
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://2019.www.torproject.org/about/torusers.html) calls for it, or for accessing hidden services.
Note that we **don't** recommend connecting over Tor on Firefox. Use the
[Tor Browser](https://www.torproject.org/download) if your
[threat model](https://2019.www.torproject.org/about/torusers.html) calls for it, or for accessing hidden services.
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.
Also be aware 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
### 🟧 sitemap
- [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)
- [common questions and answers](https://github.com/arkenfox/user.js/issues?q=is%3Aissue+label%3Aanswered)
- [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)
- [common questions and answers](https://github.com/arkenfox/user.js/issues?q=is%3Aissue+label%3Aanswered)
### 🟥 acknowledgments
Literally thousands of sources, references and suggestions. Many thanks, and much appreciated.
### 🟥 acknowledgments
Literally thousands of sources, references, and suggestions. Many thanks, and much appreciated.

View File

@ -1,144 +1,144 @@
/***
This will reset the preferences that since FF91 have been
- removed from the arkenfox user.js
- deprecated by Mozilla but listed in the arkenfox user.js in the past
This will reset the preferences that since FF91 have been
- removed from the arkenfox user.js
- deprecated by Mozilla but listed in the arkenfox user.js in the past
There is an archived version at https://github.com/arkenfox/user.js/issues/123
if you want the full list since jesus
There is an archived version at https://github.com/arkenfox/user.js/issues/123
if you want the full list since jesus
Last updated: 23-June-2024
Last updated: 23-June-2024
Instructions:
- [optional] close Firefox and backup your profile
- [optional] disable your network connection [1]
- start Firefox
- load about:config and press Ctrl+Shift+K to open the Web Console for about:config
- using about:config is important, so the script has the right permissions
- paste this script
- if you edited the list of prefs in the script, make sure the last pref does not have a trailing comma
- hit enter
- check the Info output to see which prefs were reset
- restart
- some prefs require a restart
- a restart will reapply your user.js
- [optional] re-enable your network connection
[1] Blocking Firefox from the internet ensures it cannot act on your reset preferences in the
period before you restart it, such as app and extension auto-updating, or downloading unwanted
components (GMP etc). It depends on what you're resetting and how long before you restart.
Instructions:
- [optional] close Firefox and backup your profile
- [optional] disable your network connection [1]
- start Firefox
- load about:config and press Ctrl+Shift+K to open the Web Console for about:config
- using about:config is important, so the script has the right permissions
- paste this script
- if you edited the list of prefs in the script, make sure the last pref does not have a trailing comma
- hit enter
- check the Info output to see which prefs were reset
- restart
- some prefs require a restart
- a restart will reapply your user.js
- [optional] re-enable your network connection
***/
[1] Blocking Firefox from the internet ensures it cannot act on your reset preferences in the
period before you restart it, such as app and extension auto-updating, or downloading unwanted
components (GMP etc). It depends on what you're resetting and how long before you restart.
***/
(() => {
if ('undefined' === typeof(Services)) return alert('about:config needs to be the active tab!');
if ('undefined' === typeof (Services)) return alert('about:config needs to be the active tab!');
const aPREFS = [
/* DEPRECATED */
/* 116-128 */
'browser.contentanalysis.default_allow', // 127
'browser.messaging-system.whatsNewPanel.enabled', // 126
'browser.ping-centre.telemetry', // 123
'dom.webnotifications.serviceworker.enabled', // 117
'javascript.use_us_english_locale', // 119
'layout.css.font-visibility.private', // 118
'layout.css.font-visibility.resistFingerprinting', // 116
'layout.css.font-visibility.standard', // 118
'layout.css.font-visibility.trackingprotection', // 118
'network.dns.skipTRR-when-parental-control-enabled', // 119
'permissions.delegation.enabled', // 118
'security.family_safety.mode', // 117
'widget.non-native-theme.enabled', // 127
/* 103-115 */
'browser.cache.offline.enable', // 115
'extensions.formautofill.heuristics.enabled', // 114
'network.cookie.lifetimePolicy', // 103 [technically removed in 104]
'privacy.clearsitedata.cache.enabled', // 114
'privacy.resistFingerprinting.testGranularityMask', // 114
'security.pki.sha1_enforcement_level', // 103
/* 92-102 */
'browser.urlbar.suggest.quicksuggest', // 95
'dom.securecontext.whitelist_onions', // 97
'dom.storage.next_gen', // 102
'network.http.spdy.enabled', // 100
'network.http.spdy.enabled.deps',
'network.http.spdy.enabled.http2',
'network.http.spdy.websockets',
'layout.css.font-visibility.level', // 94
'security.ask_for_password', // 102
'security.csp.enable', // 99
'security.password_lifetime', // 102
'security.ssl3.rsa_des_ede3_sha', // 93
const aPREFS = [
/* DEPRECATED */
/* 116-128 */
'browser.contentanalysis.default_allow', // 127
'browser.messaging-system.whatsNewPanel.enabled', // 126
'browser.ping-centre.telemetry', // 123
'dom.webnotifications.serviceworker.enabled', // 117
'javascript.use_us_english_locale', // 119
'layout.css.font-visibility.private', // 118
'layout.css.font-visibility.resistFingerprinting', // 116
'layout.css.font-visibility.standard', // 118
'layout.css.font-visibility.trackingprotection', // 118
'network.dns.skipTRR-when-parental-control-enabled', // 119
'permissions.delegation.enabled', // 118
'security.family_safety.mode', // 117
'widget.non-native-theme.enabled', // 127
/* 103-115 */
'browser.cache.offline.enable', // 115
'extensions.formautofill.heuristics.enabled', // 114
'network.cookie.lifetimePolicy', // 103 [technically removed in 104]
'privacy.clearsitedata.cache.enabled', // 114
'privacy.resistFingerprinting.testGranularityMask', // 114
'security.pki.sha1_enforcement_level', // 103
/* 92-102 */
'browser.urlbar.suggest.quicksuggest', // 95
'dom.securecontext.whitelist_onions', // 97
'dom.storage.next_gen', // 102
'network.http.spdy.enabled', // 100
'network.http.spdy.enabled.deps',
'network.http.spdy.enabled.http2',
'network.http.spdy.websockets',
'layout.css.font-visibility.level', // 94
'security.ask_for_password', // 102
'security.csp.enable', // 99
'security.password_lifetime', // 102
'security.ssl3.rsa_des_ede3_sha', // 93
/* REMOVED */
/* 116-128 */
'browser.fixup.alternate.enabled',
'browser.taskbar.previews.enable',
'browser.urlbar.dnsResolveSingleWordsAfterSearch',
'media.gmp-widevinecdm.enabled',
'network.protocol-handler.external.ms-windows-store',
'privacy.partition.always_partition_third_party_non_cookie_storage',
'privacy.partition.always_partition_third_party_non_cookie_storage.exempt_sessionstorage',
'privacy.partition.serviceWorkers',
/* 103-115 */
'beacon.enabled',
'browser.startup.blankWindow',
'browser.newtab.preload',
'browser.newtabpage.activity-stream.feeds.discoverystreamfeed',
'browser.newtabpage.activity-stream.feeds.snippets',
'browser.region.network.url',
'browser.region.update.enabled',
'browser.search.region',
'browser.ssl_override_behavior',
'browser.tabs.warnOnClose',
'devtools.chrome.enabled',
'dom.disable_beforeunload',
'dom.disable_open_during_load',
'dom.netinfo.enabled',
'dom.vr.enabled',
'extensions.formautofill.addresses.supported',
'extensions.formautofill.available',
'extensions.formautofill.creditCards.available',
'extensions.formautofill.creditCards.supported',
'middlemouse.contentLoadURL',
'network.http.altsvc.oe',
/* 92-102 */
'browser.urlbar.trimURLs',
'dom.caches.enabled',
'dom.storageManager.enabled',
'dom.storage_access.enabled',
'dom.targetBlankNoOpener.enabled',
'network.cookie.thirdparty.sessionOnly',
'network.cookie.thirdparty.nonsecureSessionOnly',
'privacy.firstparty.isolate.block_post_message',
'privacy.firstparty.isolate.restrict_opener_access',
'privacy.firstparty.isolate.use_site',
'privacy.window.name.update.enabled',
'security.insecure_connection_text.enabled',
/* REMOVED */
/* 116-128 */
'browser.fixup.alternate.enabled',
'browser.taskbar.previews.enable',
'browser.urlbar.dnsResolveSingleWordsAfterSearch',
'media.gmp-widevinecdm.enabled',
'network.protocol-handler.external.ms-windows-store',
'privacy.partition.always_partition_third_party_non_cookie_storage',
'privacy.partition.always_partition_third_party_non_cookie_storage.exempt_sessionstorage',
'privacy.partition.serviceWorkers',
/* 103-115 */
'beacon.enabled',
'browser.startup.blankWindow',
'browser.newtab.preload',
'browser.newtabpage.activity-stream.feeds.discoverystreamfeed',
'browser.newtabpage.activity-stream.feeds.snippets',
'browser.region.network.url',
'browser.region.update.enabled',
'browser.search.region',
'browser.ssl_override_behavior',
'browser.tabs.warnOnClose',
'devtools.chrome.enabled',
'dom.disable_beforeunload',
'dom.disable_open_during_load',
'dom.netinfo.enabled',
'dom.vr.enabled',
'extensions.formautofill.addresses.supported',
'extensions.formautofill.available',
'extensions.formautofill.creditCards.available',
'extensions.formautofill.creditCards.supported',
'middlemouse.contentLoadURL',
'network.http.altsvc.oe',
/* 92-102 */
'browser.urlbar.trimURLs',
'dom.caches.enabled',
'dom.storageManager.enabled',
'dom.storage_access.enabled',
'dom.targetBlankNoOpener.enabled',
'network.cookie.thirdparty.sessionOnly',
'network.cookie.thirdparty.nonsecureSessionOnly',
'privacy.firstparty.isolate.block_post_message',
'privacy.firstparty.isolate.restrict_opener_access',
'privacy.firstparty.isolate.use_site',
'privacy.window.name.update.enabled',
'security.insecure_connection_text.enabled',
/* IMPORTANT: last active pref must not have a trailing comma */
/* reset parrot: check your open about:config after running the script */
'_user.js.parrot'
];
/* IMPORTANT: last active pref must not have a trailing comma */
/* reset parrot: check your open about:config after running the script */
'_user.js.parrot'
];
console.clear();
console.clear();
let c = 0;
for (const sPname of aPREFS) {
if (Services.prefs.prefHasUserValue(sPname)) {
Services.prefs.clearUserPref(sPname);
if (!Services.prefs.prefHasUserValue(sPname)) {
console.info('reset', sPname);
c++;
} else console.warn('failed to reset', sPname);
let c = 0;
for (const sPname of aPREFS) {
if (Services.prefs.prefHasUserValue(sPname)) {
Services.prefs.clearUserPref(sPname);
if (!Services.prefs.prefHasUserValue(sPname)) {
console.info('reset', sPname);
c++;
} else console.warn('failed to reset', sPname);
}
}
}
focus();
focus();
const d = (c==1) ? ' pref' : ' prefs';
alert(c ? 'successfully reset ' + c + d + "\n\nfor details check the console" : 'nothing to reset');
const d = (c == 1) ? ' pref' : ' prefs';
alert(c ? 'successfully reset ' + c + d + "\n\nfor details check the console" : 'nothing to reset');
return 'all done';
return 'all done';
})();

View File

@ -1,210 +1,210 @@
/*** arkenfox user.js troubleshooter.js v1.6.3 ***/
(function() {
(function () {
if ("undefined" === typeof(Services)) return alert('about:config needs to be the active tab!');
if ("undefined" === typeof (Services)) return alert('about:config needs to be the active tab!');
const aPREFS = [
const aPREFS = [
/* known culprits */
'network.cookie.cookieBehavior',
'network.http.referer.XOriginPolicy',
'privacy.firstparty.isolate',
'privacy.resistFingerprinting',
'security.mixed_content.block_display_content',
'svg.disabled',
/* known culprits */
'network.cookie.cookieBehavior',
'network.http.referer.XOriginPolicy',
'privacy.firstparty.isolate',
'privacy.resistFingerprinting',
'security.mixed_content.block_display_content',
'svg.disabled',
/* Storage + Cache */
'browser.cache.offline.enable',
'dom.storage.enabled',
'dom.storageManager.enabled',
/* Storage + Cache */
'browser.cache.offline.enable',
'dom.storage.enabled',
'dom.storageManager.enabled',
/* Workers, Web + Push Notifications */
'dom.caches.enabled',
'dom.push.connection.enabled',
'dom.push.enabled',
'dom.push.serverURL',
'dom.serviceWorkers.enabled',
'dom.webnotifications.enabled',
'dom.webnotifications.serviceworker.enabled',
/* Workers, Web + Push Notifications */
'dom.caches.enabled',
'dom.push.connection.enabled',
'dom.push.enabled',
'dom.push.serverURL',
'dom.serviceWorkers.enabled',
'dom.webnotifications.enabled',
'dom.webnotifications.serviceworker.enabled',
/* Fonts */
'browser.display.use_document_fonts',
'font.blacklist.underline_offset',
'gfx.font_rendering.graphite.enabled',
'gfx.font_rendering.opentype_svg.enabled',
'layout.css.font-loading-api.enabled',
/* Fonts */
'browser.display.use_document_fonts',
'font.blacklist.underline_offset',
'gfx.font_rendering.graphite.enabled',
'gfx.font_rendering.opentype_svg.enabled',
'layout.css.font-loading-api.enabled',
/* Misc */
'browser.link.open_newwindow.restriction',
'canvas.capturestream.enabled',
'dom.event.clipboardevents.enabled',
'dom.event.contextmenu.enabled',
'dom.IntersectionObserver.enabled',
'dom.popup_allowed_events',
'full-screen-api.enabled',
'intl.accept_languages',
'javascript.options.asmjs',
'javascript.options.wasm',
'permissions.default.shortcuts',
/* Misc */
'browser.link.open_newwindow.restriction',
'canvas.capturestream.enabled',
'dom.event.clipboardevents.enabled',
'dom.event.contextmenu.enabled',
'dom.IntersectionObserver.enabled',
'dom.popup_allowed_events',
'full-screen-api.enabled',
'intl.accept_languages',
'javascript.options.asmjs',
'javascript.options.wasm',
'permissions.default.shortcuts',
/* Hardware */
'dom.vr.enabled',
'media.ondevicechange.enabled',
/* Hardware */
'dom.vr.enabled',
'media.ondevicechange.enabled',
/* Audio + Video */
'dom.webaudio.enabled',
'media.autoplay.default', // FF63+
'media.autoplay.blocking_policy', // FF78+
/* Audio + Video */
'dom.webaudio.enabled',
'media.autoplay.default', // FF63+
'media.autoplay.blocking_policy', // FF78+
/* Forms */
'browser.formfill.enable',
'signon.autofillForms',
'signon.formlessCapture.enabled',
/* Forms */
'browser.formfill.enable',
'signon.autofillForms',
'signon.formlessCapture.enabled',
/* HTTPS */
'security.cert_pinning.enforcement_level',
'security.family_safety.mode',
'security.OCSP.require',
'security.pki.sha1_enforcement_level',
'security.ssl.require_safe_negotiation',
'security.ssl.treat_unsafe_negotiation_as_broken',
'security.ssl3.dhe_rsa_aes_128_sha',
'security.ssl3.dhe_rsa_aes_256_sha',
'security.ssl3.ecdhe_ecdsa_aes_128_sha',
'security.ssl3.ecdhe_rsa_aes_128_sha',
'security.ssl3.rsa_aes_128_sha',
'security.ssl3.rsa_aes_256_sha',
'security.ssl3.rsa_des_ede3_sha',
'security.tls.enable_0rtt_data',
'security.tls.version.max',
'security.tls.version.min',
/* HTTPS */
'security.cert_pinning.enforcement_level',
'security.family_safety.mode',
'security.OCSP.require',
'security.pki.sha1_enforcement_level',
'security.ssl.require_safe_negotiation',
'security.ssl.treat_unsafe_negotiation_as_broken',
'security.ssl3.dhe_rsa_aes_128_sha',
'security.ssl3.dhe_rsa_aes_256_sha',
'security.ssl3.ecdhe_ecdsa_aes_128_sha',
'security.ssl3.ecdhe_rsa_aes_128_sha',
'security.ssl3.rsa_aes_128_sha',
'security.ssl3.rsa_aes_256_sha',
'security.ssl3.rsa_des_ede3_sha',
'security.tls.enable_0rtt_data',
'security.tls.version.max',
'security.tls.version.min',
/* Plugins + Flash */
'plugin.default.state',
'plugin.state.flash',
/* Plugins + Flash */
'plugin.default.state',
'plugin.state.flash',
/* unlikely to cause problems */
'dom.popup_maximum',
'geo.provider.network.url',
'layout.css.visited_links_enabled',
'mathml.disabled',
'network.auth.subresource-http-auth-allow',
'network.http.redirection-limit',
'network.protocol-handler.external.ms-windows-store',
'privacy.trackingprotection.enabled',
'security.data_uri.block_toplevel_data_uri_navigations',
'privacy.window.name.update.enabled', // FF82+
/* unlikely to cause problems */
'dom.popup_maximum',
'geo.provider.network.url',
'layout.css.visited_links_enabled',
'mathml.disabled',
'network.auth.subresource-http-auth-allow',
'network.http.redirection-limit',
'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'
]
'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 };
// 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};
function getMyList(arr) {
const aRet = [];
for (const sPname of arr) {
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+"' !");
function getMyList(arr) {
const aRet = [];
for (const sPname of arr) {
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;
}
function reapply(arr) {
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
}
}
}
function myreset(arr) {
for (const oPref of arr) Services.prefs.clearUserPref(oPref.name);
}
function resetAllMatchingDefault(arr) {
const aTmp = getMyList(arr);
myreset(aTmp);
reapply(aTmp);
}
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 !');
if (confirm('if the problem still exists click OK, otherwise click Cancel.')) {
aTmp = aTmp.slice(_h(aTmp));
} else {
aTmp = aTmp.slice(0, _h(aTmp));
aDbg = aTmp; // update narrowed down list
if (aDbg.length == 1) break;
}
reapply(aALL);
myreset(aTmp.slice(0, _h(aTmp))); // reset half of the remaining prefs
}
reapply(aALL);
if (aDbg.length == 1) return alert("narrowed it down to:\n\n"+aDbg[0].name+"\n");
if (aDbg.length == aALL.length) {
const msg = "Failed to narrow it down beyond the initial "+aALL.length+" prefs. The problem is most likely caused by at least 2 prefs!\n\n" +
"Either those prefs are too far apart in the list or there are exactly 2 culprits and they just happen to be at the wrong place.\n\n" +
"In case it's the latter, the script can add a dummy pref and you can try again - Try again?";
if (confirm(msg)) return _main([...aALL, oFILLER]);
} else if (aDbg.length > 10 && confirm("Narrowed it down to "+aDbg.length+" prefs. Try narrowing it down further?")) {
return _main(aDbg.reverse());
return aRet;
}
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);
}
function reapply(arr) {
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
}
}
}
function myreset(arr) {
for (const oPref of arr) Services.prefs.clearUserPref(oPref.name);
}
function resetAllMatchingDefault(arr) {
const aTmp = getMyList(arr);
myreset(aTmp);
reapply(aTmp);
}
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 !');
if (confirm('if the problem still exists click OK, otherwise click Cancel.')) {
aTmp = aTmp.slice(_h(aTmp));
} else {
aTmp = aTmp.slice(0, _h(aTmp));
aDbg = aTmp; // update narrowed down list
if (aDbg.length == 1) break;
}
reapply(aALL);
myreset(aTmp.slice(0, _h(aTmp))); // reset half of the remaining prefs
}
reapply(aALL);
if (aDbg.length == 1) return alert("narrowed it down to:\n\n" + aDbg[0].name + "\n");
if (aDbg.length == aALL.length) {
const msg = "Failed to narrow it down beyond the initial " + aALL.length + " prefs. The problem is most likely caused by at least 2 prefs!\n\n" +
"Either those prefs are too far apart in the list or there are exactly 2 culprits and they just happen to be at the wrong place.\n\n" +
"In case it's the latter, the script can add a dummy pref and you can try again - Try again?";
if (confirm(msg)) return _main([...aALL, oFILLER]);
} else if (aDbg.length > 10 && confirm("Narrowed it down to " + aDbg.length + " prefs. Try narrowing it down further?")) {
return _main(aDbg.reverse());
}
alert("Narrowed it down to " + aDbg.length.toString() + " prefs, check the console ...");
console.log('The problem is caused by 2 or more of these prefs:');
for (const oPref of aDbg) console.log(oPref.name);
}
resetAllMatchingDefault(aPREFS); // reset user-set prefs matching FFs default value
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.");
const aBAK = getMyList(aPREFS);
//console.log(aBAK.length, "user-set prefs from our list detected and their values stored.");
const sMsg = "all detected prefs reset.\n\n" +
const sMsg = "all detected prefs reset.\n\n" +
"!! KEEP THIS PROMPT OPEN AND TEST THE SITE IN ANOTHER TAB !!\n\n" +
"IF the problem still exists, this script can't help you - click Cancel to re-apply your values and exit.\n\n" +
"Click OK if your problem is fixed.";
focus();
myreset(aBAK);
if (!confirm(sMsg)) {
reapply(aBAK);
return;
}
_main(aBAK);
focus();
myreset(aBAK);
if (!confirm(sMsg)) {
reapply(aBAK);
return;
}
_main(aBAK);
})();

636
user.js

File diff suppressed because it is too large Load Diff

View File

@ -1 +1,20 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="78" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="78" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h47v20H0z"/><path fill="#dfb317" d="M47 0h31v20H47z"/><path fill="url(#b)" d="M0 0h78v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="245" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">license</text><text x="245" y="140" transform="scale(.1)" textLength="370">license</text><text x="615" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">MIT</text><text x="615" y="140" transform="scale(.1)" textLength="210">MIT</text></g> </svg>
<svg xmlns="http://www.w3.org/2000/svg" width="78" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<clipPath id="a">
<rect width="78" height="20" rx="3" fill="#fff"/>
</clipPath>
<g clip-path="url(#a)">
<path fill="#555" d="M0 0h47v20H0z"/>
<path fill="#dfb317" d="M47 0h31v20H47z"/>
<path fill="url(#b)" d="M0 0h78v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
<text x="245" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">license</text>
<text x="245" y="140" transform="scale(.1)" textLength="370">license</text>
<text x="615" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">MIT</text>
<text x="615" y="140" transform="scale(.1)" textLength="210">MIT</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 950 B

After

Width:  |  Height:  |  Size: 1.0 KiB