OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 440 |
441 /** | 441 /** |
442 * Generator serializing filter data and yielding it line by line. | 442 * Generator serializing filter data and yielding it line by line. |
443 */ | 443 */ |
444 *exportData() | 444 *exportData() |
445 { | 445 { |
446 // Do not persist external subscriptions | 446 // Do not persist external subscriptions |
447 let subscriptions = []; | 447 let subscriptions = []; |
448 for (let subscription of this.subscriptions()) | 448 for (let subscription of this.subscriptions()) |
449 { | 449 { |
450 if (!(subscription instanceof ExternalSubscription)) | 450 if (!(subscription instanceof ExternalSubscription) && |
| 451 !(subscription instanceof SpecialSubscription && |
| 452 subscription.filters.length == 0)) |
| 453 { |
451 subscriptions.push(subscription); | 454 subscriptions.push(subscription); |
| 455 } |
452 } | 456 } |
453 | 457 |
454 yield "# Adblock Plus preferences"; | 458 yield "# Adblock Plus preferences"; |
455 yield "version=" + formatVersion; | 459 yield "version=" + formatVersion; |
456 | 460 |
457 let saved = new Set(); | 461 let saved = new Set(); |
458 let buf = []; | 462 let buf = []; |
459 | 463 |
460 // Save subscriptions | 464 // Save subscriptions |
461 for (let subscription of subscriptions) | 465 for (let subscription of subscriptions) |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 * @param {Subscription} subscription filter subscription to be removed | 654 * @param {Subscription} subscription filter subscription to be removed |
651 */ | 655 */ |
652 function removeSubscriptionFilters(subscription) | 656 function removeSubscriptionFilters(subscription) |
653 { | 657 { |
654 if (!FilterStorage.knownSubscriptions.has(subscription.url)) | 658 if (!FilterStorage.knownSubscriptions.has(subscription.url)) |
655 return; | 659 return; |
656 | 660 |
657 for (let filter of subscription.filters) | 661 for (let filter of subscription.filters) |
658 filter.removeSubscription(subscription); | 662 filter.removeSubscription(subscription); |
659 } | 663 } |
OLD | NEW |