Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit e6092ad

Browse files
committed
remove workaround rule formerly needed for #302
1 parent 37b9303 commit e6092ad

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

js/storage.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,32 @@ HTTPSB.loadScopedRules = function() {
135135

136136
HTTPSB.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

Comments
 (0)