Index: lib/subscriptionInit.js |
=================================================================== |
--- a/lib/subscriptionInit.js |
+++ b/lib/subscriptionInit.js |
@@ -206,17 +206,19 @@ |
Prefs.subscriptions_antiadblockurl |
); |
antiAdblockSubscription.disabled = true; |
subscriptions.push(antiAdblockSubscription); |
} |
} |
// Add default ad blocking subscription (e.g. EasyList) |
kzar
2018/07/16 13:39:23
Please could you fix this comment?
hub
2018/07/16 15:50:06
Done.
|
- if (shouldAddDefaultSubscription()) |
+ // Ensure the anti-circumvention subscription is added on upgrade. |
kzar
2018/07/16 13:39:23
Nit: Please could you move this line of the commen
hub
2018/07/16 15:50:06
Done (and edited).
|
+ let addDefaultSubscription = shouldAddDefaultSubscription(); |
+ if (addDefaultSubscription || !Prefs.subscriptions_checkedanticv) |
{ |
return fetch("subscriptions.xml") |
.then(response => response.text()) |
.then(text => |
{ |
let doc = new DOMParser().parseFromString(text, "application/xml"); |
let nodes = doc.getElementsByTagName("subscription"); |
@@ -224,25 +226,31 @@ |
if (defaultSubscriptions) |
{ |
for (let name in defaultSubscriptions) |
{ |
let node = defaultSubscriptions[name]; |
if (!node) |
continue; |
+ let type = node.getAttribute("type"); |
kzar
2018/07/16 13:39:23
I wonder why we do this before the `url` check, si
hub
2018/07/16 15:50:06
True that.
Moved inside the if (url)
|
+ if (!addDefaultSubscription && type != "circumvention") |
+ continue; |
+ |
let url = node.getAttribute("url"); |
if (url) |
{ |
let subscription = Subscription.fromURL(url); |
subscription.disabled = false; |
subscription.title = node.getAttribute("title"); |
subscription.homepage = node.getAttribute("homepage"); |
- subscription.type = node.getAttribute("type"); |
+ subscription.type = type; |
subscriptions.push(subscription); |
+ if (subscription.type == "circumvention") |
+ Prefs.subscriptions_checkedanticv = true; |
} |
} |
} |
return subscriptions; |
}); |
} |