@@ -135,20 +135,32 @@ HTTPSB.loadScopedRules = function() {
135135
136136HTTPSB . loadUbiquitousWhitelists = function ( ) {
137137 var onLoaded = function ( details ) {
138- if ( ! details . error ) {
139- var httpsb = HTTPSB ;
140- httpsb . ubiquitousWhitelist . reset ( ) ;
141- httpsb . mergeUbiquitousWhitelist ( details ) ;
142- httpsb . ubiquitousWhitelist . freeze ( ) ;
138+ if ( details . error ) {
139+ return ;
140+ }
141+ var httpsb = HTTPSB ;
142+
143+ // https://github.com/gorhill/httpswitchboard/issues/302
144+ // Remove workaround rule, now that right-anchoring is supported, the
145+ // workaround rule would prevent the good block rule in EasyPrivacy
146+ // from working.
147+ // TODO: remove this code when I am confident nobody has this
148+ // workaround rule in their settings.
149+ if ( details . content . indexOf ( '@@||docs.google.com/stat|$xmlhttprequest' ) >= 0 ) {
150+ details . content = details . content
151+ . replace ( '@@||docs.google.com/stat|$xmlhttprequest,domain=docs.google.com' , '' )
152+ . replace ( '@@||docs.google.com/stat|$xmlhttprequest' , '' ) ;
153+ httpsb . assets . put ( httpsb . userWhitelistPath , details . content , function ( ) { } ) ;
143154 }
155+
156+ httpsb . ubiquitousWhitelist . reset ( ) ;
157+ httpsb . mergeUbiquitousWhitelist ( details ) ;
158+ httpsb . ubiquitousWhitelist . freeze ( ) ;
144159 } ;
145160
146161 // ONLY the user decides what to whitelist uniquitously, so no need
147162 // for code to handle 3rd-party lists.
148- this . assets . get (
149- 'assets/user/ubiquitous-whitelisted-hosts.txt' ,
150- onLoaded
151- ) ;
163+ this . assets . get ( HTTPSB . userWhitelistPath , onLoaded ) ;
152164} ;
153165
154166/******************************************************************************/
0 commit comments