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

Delta Between Two Patch Sets: adblockplus/Api.jsm

Issue 29543774: Issue 2801 - Create 'Whitelisted websites' screen and add link to 'Ad blocking' screen (Closed)
Left Patch Set: Created Sept. 13, 2017, 5:01 p.m.
Right Patch Set: Adjustments accordingly to Thomas's comments. Also, adjusting strings for multilocale build Created Sept. 19, 2017, 3:18 p.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
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-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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 { 189 {
190 let whitelistedWebsites = []; 190 let whitelistedWebsites = [];
191 for (let i = 0; i < FilterStorage.subscriptions.length; i++) 191 for (let i = 0; i < FilterStorage.subscriptions.length; i++)
192 { 192 {
193 let subscription = FilterStorage.subscriptions[i]; 193 let subscription = FilterStorage.subscriptions[i];
194 if (subscription.url && subscription.url.startsWith("~user~") && subscript ion.filters) 194 if (subscription.url && subscription.url.startsWith("~user~") && subscript ion.filters)
195 { 195 {
196 for (let j = 0; j < subscription.filters.length; j++) 196 for (let j = 0; j < subscription.filters.length; j++)
197 { 197 {
198 let filter = subscription.filters[j]; 198 let filter = subscription.filters[j];
199 let whitelistMatch = filter.text ? filter.text.match(/@@\|\|(.*)\^\$do cument/) : null; 199 let whitelistMatch = filter.text ? filter.text.match(/^@@\|\|([^/:]+)\ ^\$document$/) : null;
Thomas Greiner 2017/09/15 15:08:06 We're using a slightly different regular expressio
diegocarloslima 2017/09/18 14:16:36 Acknowledged.
200 if(whitelistMatch) 200 if(whitelistMatch)
201 { 201 {
202 whitelistedWebsites.push({"url": whitelistMatch[1]}) 202 whitelistedWebsites.push({"url": whitelistMatch[1]})
203 } 203 }
204 } 204 }
205 } 205 }
206 } 206 }
207 return whitelistedWebsites; 207 return whitelistedWebsites;
208 }, 208 },
209 isWebsiteWhitelisted: function(url, host) 209 isWebsiteWhitelisted: function(url, host)
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 { 307 {
308 this.whitelistWebsite(data["url"], data["host"], data["whitelisted"] ); 308 this.whitelistWebsite(data["url"], data["host"], data["whitelisted"] );
309 return {"success": true}; 309 return {"success": true};
310 } 310 }
311 break; 311 break;
312 } 312 }
313 return {"success": false, "error": "malformed request"}; 313 return {"success": false, "error": "malformed request"};
314 }).bind(this), "AdblockPlus:Api"); 314 }).bind(this), "AdblockPlus:Api");
315 } 315 }
316 }; 316 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld