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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 for (let i = 0; i < this.needUpdate.length; i++) | 818 for (let i = 0; i < this.needUpdate.length; i++) |
819 if (Synchronizer.isExecuting(this.needUpdate[i].url)) | 819 if (Synchronizer.isExecuting(this.needUpdate[i].url)) |
820 return; | 820 return; |
821 | 821 |
822 FilterNotifier.removeListener(listener); | 822 FilterNotifier.removeListener(listener); |
823 E("updateInProgress").hidden = "true"; | 823 E("updateInProgress").hidden = "true"; |
824 | 824 |
825 let filtersRemoved = false; | 825 let filtersRemoved = false; |
826 let requests = requestsDataSource.origRequests; | 826 let requests = requestsDataSource.origRequests; |
827 for (let i = 0; i < requests.length; i++) | 827 for (let i = 0; i < requests.length; i++) |
828 if (requests[i].filter && !requests[i].filter.subscriptions.filter(s =
> !s.disabled).length) | 828 { |
| 829 if (!requests[i].filter) |
| 830 continue; |
| 831 |
| 832 let filter = Filter.fromText(requests[i].filter); |
| 833 if (!filter.subscriptions.some(s => !s.disabled)) |
829 filtersRemoved = true; | 834 filtersRemoved = true; |
| 835 } |
830 | 836 |
831 if (filtersRemoved) | 837 if (filtersRemoved) |
832 { | 838 { |
833 // Force the user to reload the page | 839 // Force the user to reload the page |
834 E("updateFixedIssue").hidden = false; | 840 E("updateFixedIssue").hidden = false; |
835 document.documentElement.canAdvance = true; | 841 document.documentElement.canAdvance = true; |
836 | 842 |
837 let nextButton = document.documentElement.getButton("next"); | 843 let nextButton = document.documentElement.getButton("next"); |
838 [nextButton.label, nextButton.accessKey] = Utils.splitLabel(E("updateP
age").getAttribute("reloadButtonLabel")); | 844 [nextButton.label, nextButton.accessKey] = Utils.splitLabel(E("updateP
age").getAttribute("reloadButtonLabel")); |
839 document.documentElement.addEventListener("wizardnext", function(event
) | 845 document.documentElement.addEventListener("wizardnext", function(event
) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 { | 911 { |
906 return subscriptionsDataSource.subscriptionFilter(s); | 912 return subscriptionsDataSource.subscriptionFilter(s); |
907 } | 913 } |
908 else | 914 else |
909 return false; | 915 return false; |
910 }, | 916 }, |
911 | 917 |
912 collectData: function(wnd, windowURI, callback) | 918 collectData: function(wnd, windowURI, callback) |
913 { | 919 { |
914 this.contentWnd = wnd; | 920 this.contentWnd = wnd; |
915 this.whitelistFilter = Policy.isWhitelisted(windowURI.spec); | 921 this.whitelistFilter = Policy.isWhitelisted(windowURI.spec); |
916 | 922 |
917 if (!this.whitelistFilter && this.isEnabled) | 923 if (!this.whitelistFilter && this.isEnabled) |
918 { | 924 { |
919 // Find disabled filters in active subscriptions matching any of the reque
sts | 925 // Find disabled filters in active subscriptions matching any of the reque
sts |
920 let disabledMatcher = new CombinedMatcher(); | 926 let disabledMatcher = new CombinedMatcher(); |
921 for (let subscription of FilterStorage.subscriptions) | 927 for (let subscription of FilterStorage.subscriptions) |
922 { | 928 { |
923 if (subscription.disabled) | 929 if (subscription.disabled) |
924 continue; | 930 continue; |
925 | 931 |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 | 1590 |
1585 function censorURL(url) | 1591 function censorURL(url) |
1586 { | 1592 { |
1587 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); | 1593 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); |
1588 } | 1594 } |
1589 | 1595 |
1590 function encodeHTML(str) | 1596 function encodeHTML(str) |
1591 { | 1597 { |
1592 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").
replace(/"/g, """); | 1598 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").
replace(/"/g, """); |
1593 } | 1599 } |
OLD | NEW |