@@ -804,17 +804,19 @@ HTTPSEverywhere.prototype = {
804804 let prefService = Services . prefs ;
805805 let thisBranch =
806806 prefService . getBranch ( "extensions.https_everywhere.http_nowhere." ) ;
807+ let networkBranch = prefService . getBranch ( "network." ) ;
808+ let securityBranch = prefService . getBranch ( "security." ) ;
807809
808810 // Proxy type. 0: none, 1: manual, 2: autoconfig by URL, 3: same as 0,
809811 // 4: autodetect proxy settings, 5: use system proxy settings (default)
810- let PROXY_TYPE = "network. proxy.type" ;
812+ let PROXY_TYPE = "proxy.type" ;
811813 // HTTP proxy host
812- let PROXY_HTTP = "network. proxy.http" ;
814+ let PROXY_HTTP = "proxy.http" ;
813815 // HTTP proxy port
814- let PROXY_PORT = "network. proxy.http_port" ;
816+ let PROXY_PORT = "proxy.http_port" ;
815817
816818 // Whether cert is treated as invalid when OCSP connection fails
817- let OCSP_REQUIRED = "security.ocsp .require" ;
819+ let OCSP_REQUIRED = "OCSP .require" ;
818820
819821 // Original settings
820822 let ORIG_PROXY_TYPE = "orig.proxy.type" ;
@@ -827,39 +829,39 @@ HTTPSEverywhere.prototype = {
827829 // Restore original proxy/OCSP settings. TODO: What if user manually edits
828830 // these while HTTP Nowhere is enabled?
829831 let origProxyType = thisBranch . getIntPref ( ORIG_PROXY_TYPE ) ;
830- prefService . setIntPref ( PROXY_TYPE , origProxyType ) ;
832+ networkBranch . setIntPref ( PROXY_TYPE , origProxyType ) ;
831833
832834 let origProxyHttp = thisBranch . getCharPref ( ORIG_PROXY_HTTP ) ;
833- prefService . setCharPref ( PROXY_HTTP , origProxyHttp ) ;
835+ networkBranch . setCharPref ( PROXY_HTTP , origProxyHttp ) ;
834836
835837 let origProxyPort = thisBranch . getIntPref ( ORIG_PROXY_PORT ) ;
836- prefService . setIntPref ( PROXY_PORT , origProxyPort ) ;
838+ networkBranch . setIntPref ( PROXY_PORT , origProxyPort ) ;
837839
838840 let origOcspRequired = thisBranch . getBoolPref ( ORIG_OCSP_REQUIRED ) ;
839- prefService . setBoolPref ( OCSP_REQUIRED , origOcspRequired ) ;
841+ securityBranch . setBoolPref ( OCSP_REQUIRED , origOcspRequired ) ;
840842
841843 thisBranch . setBoolPref ( "enabled" , false ) ;
842844 } else {
843845 // Save original proxy settings in HTTP Nowhere preferences branch.
844- let origProxyType = prefService . getIntPref ( PROXY_TYPE ) ;
846+ let origProxyType = networkBranch . getIntPref ( PROXY_TYPE ) ;
845847 thisBranch . setIntPref ( ORIG_PROXY_TYPE , origProxyType ) ;
846848
847- let origProxyHttp = prefService . getCharPref ( PROXY_HTTP ) ;
849+ let origProxyHttp = networkBranch . getCharPref ( PROXY_HTTP ) ;
848850 thisBranch . setCharPref ( ORIG_PROXY_HTTP , origProxyHttp ) ;
849851
850- let origProxyPort = prefService . getIntPref ( PROXY_PORT ) ;
852+ let origProxyPort = networkBranch . getIntPref ( PROXY_PORT ) ;
851853 thisBranch . setIntPref ( ORIG_PROXY_PORT , origProxyPort ) ;
852854
853- let origOcspRequired = prefService . getBoolPref ( OCSP_REQUIRED ) ;
855+ let origOcspRequired = securityBranch . getBoolPref ( OCSP_REQUIRED ) ;
854856 thisBranch . setBoolPref ( ORIG_OCSP_REQUIRED , origOcspRequired ) ;
855857
856858 // Set a null proxy for HTTP requests
857- prefService . setIntPref ( PROXY_TYPE , 1 ) ; // manual
858- prefService . setCharPref ( PROXY_HTTP , "localhost" ) ;
859- prefService . setIntPref ( PROXY_PORT , 4 ) ; // any arbitrary unused port
859+ networkBranch . setIntPref ( PROXY_TYPE , 1 ) ; // manual
860+ networkBranch . setCharPref ( PROXY_HTTP , "localhost" ) ;
861+ networkBranch . setIntPref ( PROXY_PORT , 4 ) ; // any arbitrary unused port
860862
861863 // Disable OCSP enforcement
862- thisBranch . setBoolPref ( OCSP_REQUIRED , false ) ;
864+ securityBranch . setBoolPref ( OCSP_REQUIRED , false ) ;
863865
864866 thisBranch . setBoolPref ( "enabled" , true ) ;
865867 }
0 commit comments