| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 this.data.parentNode.removeChild(this.data); | 726 this.data.parentNode.removeChild(this.data); |
| 727 } | 727 } |
| 728 }; | 728 }; |
| 729 | 729 |
| 730 let subscriptionUpdateDataSource = | 730 let subscriptionUpdateDataSource = |
| 731 { | 731 { |
| 732 contentWnd: null, | 732 contentWnd: null, |
| 733 type: null, | 733 type: null, |
| 734 outdated: null, | 734 outdated: null, |
| 735 needUpdate: null, | 735 needUpdate: null, |
| 736 |
| 737 subscriptionFilter: function(s) |
| 738 { |
| 739 if (s instanceof DownloadableSubscription) |
| 740 return subscriptionsDataSource.subscriptionFilter(s); |
| 741 else |
| 742 return false; |
| 743 }, |
| 736 | 744 |
| 737 collectData: function(wnd, windowURI, callback) | 745 collectData: function(wnd, windowURI, callback) |
| 738 { | 746 { |
| 739 this.contentWnd = wnd; | 747 this.contentWnd = wnd; |
| 740 let now = Date.now() / MILLISECONDS_IN_SECOND; | 748 let now = Date.now() / MILLISECONDS_IN_SECOND; |
| 741 let outdatedThreshold = now - 14 * SECONDS_IN_DAY; | 749 let outdatedThreshold = now - 14 * SECONDS_IN_DAY; |
| 742 let needUpdateThreshold = now - 1 * SECONDS_IN_HOUR; | 750 let needUpdateThreshold = now - 1 * SECONDS_IN_HOUR; |
| 743 | 751 |
| 744 this.outdated = []; | 752 this.outdated = []; |
| 745 this.needUpdate = []; | 753 this.needUpdate = []; |
| 746 | 754 |
| 747 let subscriptions = FilterStorage.subscriptions.filter(issuesDataSource.subs
criptionFilter); | 755 let subscriptions = FilterStorage.subscriptions.filter(this.subscriptionFilt
er); |
| 748 for (let i = 0; i < subscriptions.length; i++) | 756 for (let i = 0; i < subscriptions.length; i++) |
| 749 { | 757 { |
| 750 let lastSuccess = subscriptions[i].lastSuccess; | 758 let lastSuccess = subscriptions[i].lastSuccess; |
| 751 if (lastSuccess < outdatedThreshold) | 759 if (lastSuccess < outdatedThreshold) |
| 752 this.outdated.push(subscriptions[i]); | 760 this.outdated.push(subscriptions[i]); |
| 753 if (lastSuccess < needUpdateThreshold) | 761 if (lastSuccess < needUpdateThreshold) |
| 754 this.needUpdate.push(subscriptions[i]); | 762 this.needUpdate.push(subscriptions[i]); |
| 755 } | 763 } |
| 756 | 764 |
| 757 callback(); | 765 callback(); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 isEnabled: Prefs.enabled, | 885 isEnabled: Prefs.enabled, |
| 878 whitelistFilter: null, | 886 whitelistFilter: null, |
| 879 disabledFilters: [], | 887 disabledFilters: [], |
| 880 disabledSubscriptions: [], | 888 disabledSubscriptions: [], |
| 881 ownFilters: [], | 889 ownFilters: [], |
| 882 numSubscriptions: 0, | 890 numSubscriptions: 0, |
| 883 numAppliedFilters: Infinity, | 891 numAppliedFilters: Infinity, |
| 884 | 892 |
| 885 subscriptionFilter: function(s) | 893 subscriptionFilter: function(s) |
| 886 { | 894 { |
| 887 if (s instanceof DownloadableSubscription) | 895 if (s instanceof DownloadableSubscription && |
| 896 s.url != Prefs.subscriptions_exceptionsurl && |
| 897 s.url != Prefs.subscriptions_antiadblockurl) |
| 898 { |
| 888 return subscriptionsDataSource.subscriptionFilter(s); | 899 return subscriptionsDataSource.subscriptionFilter(s); |
| 900 } |
| 889 else | 901 else |
| 890 return false; | 902 return false; |
| 891 }, | 903 }, |
| 892 | 904 |
| 893 collectData: function(wnd, windowURI, callback) | 905 collectData: function(wnd, windowURI, callback) |
| 894 { | 906 { |
| 895 this.contentWnd = wnd; | 907 this.contentWnd = wnd; |
| 896 this.whitelistFilter = Policy.isWindowWhitelisted(wnd); | 908 this.whitelistFilter = Policy.isWindowWhitelisted(wnd); |
| 897 | 909 |
| 898 if (!this.whitelistFilter && this.isEnabled) | 910 if (!this.whitelistFilter && this.isEnabled) |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1562 | 1574 |
| 1563 function censorURL(url) | 1575 function censorURL(url) |
| 1564 { | 1576 { |
| 1565 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); | 1577 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); |
| 1566 } | 1578 } |
| 1567 | 1579 |
| 1568 function encodeHTML(str) | 1580 function encodeHTML(str) |
| 1569 { | 1581 { |
| 1570 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").
replace(/"/g, """); | 1582 return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").
replace(/"/g, """); |
| 1571 } | 1583 } |
| OLD | NEW |