Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/subscriptionInit.js

Issue 29827646: Issue 6783 - opt-in to anti circumvention filter list on upgrade (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Don't re-ad default easylist Created July 12, 2018, 5:13 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/prefs.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
- if (shouldAddDefaultSubscription())
+ // Ensure the Anti Circumvention is added on upgrade.
Manish Jethani 2018/07/13 15:20:25 You mean anti-circumvention subscription?
hub 2018/07/13 17:23:59 Done.
+ 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");
+ 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;
});
}
« no previous file with comments | « lib/prefs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld