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

Delta Between Two Patch Sets: chrome/content/ui/sendReport.js

Issue 29333150: Issue 3461 - Fixed: Issue Reporter assumes that RequestEntry.filter is a Filter instance, not a str… (Closed)
Left Patch Set: Created Jan. 4, 2016, 5:46 p.m.
Right Patch Set: Addressed comment Created Jan. 5, 2016, 9:49 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 { 828 {
829 if (!requests[i].filter) 829 if (!requests[i].filter)
830 continue; 830 continue;
831 831
832 let filter = Filter.fromText(requests[i].filter); 832 let filter = Filter.fromText(requests[i].filter);
833 if (!filter.subscriptions.filter(s => !s.disabled).length) 833 if (!filter.subscriptions.some(s => !s.disabled))
Sebastian Noack 2016/01/05 09:20:52 How about |filter.subscriptions.some(s => !s.disab
Wladimir Palant 2016/01/05 09:50:08 This functionality isn't exactly easy to test. But
834 filtersRemoved = true; 834 filtersRemoved = true;
835 } 835 }
836 836
837 if (filtersRemoved) 837 if (filtersRemoved)
838 { 838 {
839 // Force the user to reload the page 839 // Force the user to reload the page
840 E("updateFixedIssue").hidden = false; 840 E("updateFixedIssue").hidden = false;
841 document.documentElement.canAdvance = true; 841 document.documentElement.canAdvance = true;
842 842
843 let nextButton = document.documentElement.getButton("next"); 843 let nextButton = document.documentElement.getButton("next");
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 { 911 {
912 return subscriptionsDataSource.subscriptionFilter(s); 912 return subscriptionsDataSource.subscriptionFilter(s);
913 } 913 }
914 else 914 else
915 return false; 915 return false;
916 }, 916 },
917 917
918 collectData: function(wnd, windowURI, callback) 918 collectData: function(wnd, windowURI, callback)
919 { 919 {
920 this.contentWnd = wnd; 920 this.contentWnd = wnd;
921 this.whitelistFilter = Policy.isWindowWhitelisted(wnd); 921 this.whitelistFilter = Policy.isWhitelisted(windowURI.spec);
Wladimir Palant 2016/01/05 09:50:08 A change is being shown in the interdiff here - th
922 922
923 if (!this.whitelistFilter && this.isEnabled) 923 if (!this.whitelistFilter && this.isEnabled)
924 { 924 {
925 // 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
926 let disabledMatcher = new CombinedMatcher(); 926 let disabledMatcher = new CombinedMatcher();
927 for (let subscription of FilterStorage.subscriptions) 927 for (let subscription of FilterStorage.subscriptions)
928 { 928 {
929 if (subscription.disabled) 929 if (subscription.disabled)
930 continue; 930 continue;
931 931
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 1590
1591 function censorURL(url) 1591 function censorURL(url)
1592 { 1592 {
1593 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*"); 1593 return url.replace(/([?;&\/#][^?;&\/#]+?=)[^?;&\/#]+/g, "$1*");
1594 } 1594 }
1595 1595
1596 function encodeHTML(str) 1596 function encodeHTML(str)
1597 { 1597 {
1598 return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"). replace(/"/g, "&quot;"); 1598 return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"). replace(/"/g, "&quot;");
1599 } 1599 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld