Index: lib/filterStorage.js |
=================================================================== |
--- a/lib/filterStorage.js |
+++ b/lib/filterStorage.js |
@@ -472,45 +472,39 @@ |
} |
/** |
* Generator serializing filter data and yielding it line by line. |
* @yields {string} |
*/ |
*exportData() |
{ |
- // Do not persist external subscriptions |
- let subscriptions = []; |
- for (let subscription of this.subscriptions()) |
- { |
- if (!(subscription instanceof ExternalSubscription) && |
- !(subscription instanceof SpecialSubscription && |
- subscription.filterCount == 0)) |
- { |
- subscriptions.push(subscription); |
- } |
- } |
- |
yield "# Adblock Plus preferences"; |
yield "version=" + this.formatVersion; |
let saved = new Set(); |
// Save subscriptions |
- for (let subscription of subscriptions) |
+ for (let subscription of this.subscriptions()) |
{ |
- yield* subscription.serialize(); |
- yield* subscription.serializeFilters(); |
- } |
+ // Do not persist external subscriptions |
+ if (!(subscription instanceof ExternalSubscription) && |
+ !(subscription instanceof SpecialSubscription && |
+ subscription.filters.length == 0)) |
+ { |
+ yield* subscription.serialize(); |
+ yield* subscription.serializeFilters(); |
+ } |
// Save filter data |
for (let subscription of subscriptions) |
{ |
for (let filter of subscription.filters()) |
{ |
+ // Save filter data |
if (!saved.has(filter.text)) |
{ |
yield* filter.serialize(); |
saved.add(filter.text); |
} |
} |
} |
} |