2018-01-09 16:03:46 +01:00
2020-12-16 15:40:42 +01:00
/*** arkenfox user.js troubleshooter.js v1.6.3 ***/
2018-01-15 17:06:22 +01:00
2018-01-09 16:03:46 +01:00
( function ( ) {
2019-11-11 16:10:14 +01:00
if ( "undefined" === typeof ( Services ) ) return alert ( 'about:config needs to be the active tab!' ) ;
2018-01-09 16:03:46 +01:00
2019-11-11 16:10:14 +01:00
const aPREFS = [
2018-01-16 16:52:24 +01:00
/* known culprits */
'network.cookie.cookieBehavior' ,
'network.http.referer.XOriginPolicy' ,
'privacy.firstparty.isolate' ,
'privacy.resistFingerprinting' ,
'security.mixed_content.block_display_content' ,
'svg.disabled' ,
/* Storage + Cache */
2018-01-09 16:03:46 +01:00
'browser.cache.offline.enable' ,
2018-01-16 16:52:24 +01:00
'dom.storage.enabled' ,
'dom.storageManager.enabled' ,
/* Workers, Web + Push Notifications */
2018-01-09 16:03:46 +01:00
'dom.caches.enabled' ,
'dom.push.connection.enabled' ,
'dom.push.enabled' ,
'dom.push.serverURL' ,
'dom.serviceWorkers.enabled' ,
'dom.webnotifications.enabled' ,
'dom.webnotifications.serviceworker.enabled' ,
2018-01-16 16:52:24 +01:00
/* Fonts */
'browser.display.use_document_fonts' ,
2018-01-09 16:03:46 +01:00
'font.blacklist.underline_offset' ,
'gfx.font_rendering.graphite.enabled' ,
'gfx.font_rendering.opentype_svg.enabled' ,
2018-01-16 16:52:24 +01:00
'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' ,
2018-01-09 16:03:46 +01:00
'intl.accept_languages' ,
'javascript.options.asmjs' ,
'javascript.options.wasm' ,
2018-02-03 14:21:57 +01:00
'permissions.default.shortcuts' ,
2018-01-16 16:52:24 +01:00
/* Hardware */
'dom.vr.enabled' ,
'media.ondevicechange.enabled' ,
/* Audio + Video */
'dom.webaudio.enabled' ,
2018-12-17 09:19:14 +01:00
'media.autoplay.default' , // FF63+
2020-10-21 15:44:21 +02:00
'media.autoplay.blocking_policy' , // FF78+
2018-01-16 16:52:24 +01:00
/* Forms */
'browser.formfill.enable' ,
'signon.autofillForms' ,
'signon.formlessCapture.enabled' ,
/* HTTPS */
2018-01-09 16:03:46 +01:00
'security.cert_pinning.enforcement_level' ,
'security.family_safety.mode' ,
'security.OCSP.require' ,
'security.pki.sha1_enforcement_level' ,
2018-01-15 17:06:22 +01:00
'security.ssl.require_safe_negotiation' ,
2018-01-09 16:03:46 +01:00
'security.ssl.treat_unsafe_negotiation_as_broken' ,
2018-01-15 17:06:22 +01:00
'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' ,
2018-01-09 16:03:46 +01:00
'security.tls.enable_0rtt_data' ,
'security.tls.version.max' ,
'security.tls.version.min' ,
2018-01-16 16:52:24 +01:00
/* Plugins + Flash */
'plugin.default.state' ,
'plugin.state.flash' ,
2018-01-09 16:03:46 +01:00
2018-01-16 16:52:24 +01:00
/* unlikely to cause problems */
'dom.popup_maximum' ,
2020-12-16 15:43:46 +01:00
'geo.provider.network.url' ,
2018-01-16 16:52:24 +01:00
'layout.css.visited_links_enabled' ,
'mathml.disabled' ,
2018-12-17 14:00:27 +01:00
'network.auth.subresource-http-auth-allow' ,
2018-01-16 16:52:24 +01:00
'network.http.redirection-limit' ,
'network.protocol-handler.external.ms-windows-store' ,
'privacy.trackingprotection.enabled' ,
'security.data_uri.block_toplevel_data_uri_navigations' ,
2020-11-17 20:17:59 +01:00
'privacy.window.name.update.enabled' , // FF82+
2018-01-16 16:52:24 +01:00
2018-01-09 16:03:46 +01:00
'last.one.without.comma'
]
2019-11-11 16:10:14 +01:00
// any runtime-set pref that everyone will have and that can be safely reset
2020-04-29 14:00:10 +02:00
const oFILLER = { type : 64 , name : 'app.update.lastUpdateTime.browser-cleanup-thumbnails' , value : 1580000000 } ;
2018-01-09 16:03:46 +01:00
2019-11-11 16:10:14 +01:00
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 ;
}
2018-01-09 16:03:46 +01:00
2019-11-11 16:10:14 +01:00
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
}
}
}
2018-01-09 16:03:46 +01:00
2019-11-11 16:10:14 +01:00
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 ) {
2018-01-09 16:03:46 +01:00
alert ( "NOW TEST AGAIN !" ) ;
if ( confirm ( "if the problem still exists click OK, otherwise click cancel." ) ) {
2019-11-11 16:10:14 +01:00
aTmp = aTmp . slice ( _h ( aTmp ) ) ;
2018-01-09 16:03:46 +01:00
} else {
2019-11-11 16:10:14 +01:00
aTmp = aTmp . slice ( 0 , _h ( aTmp ) ) ;
aDbg = aTmp ; // update narrowed down list
if ( aDbg . length == 1 ) break ;
2018-01-09 16:03:46 +01:00
}
2019-11-11 16:10:14 +01:00
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 ) {
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 ( ) ) ;
2018-01-09 16:03:46 +01:00
}
2019-11-11 16:10:14 +01:00
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 ) ;
2018-01-16 16:52:24 +01:00
}
2019-11-11 16:10:14 +01:00
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 ) ;
2018-01-15 20:19:34 +01:00
return ;
2018-01-09 16:03:46 +01:00
}
2019-11-11 16:10:14 +01:00
_main ( aBAK ) ;
2018-01-09 16:03:46 +01:00
} ) ( ) ;