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

Delta Between Two Patch Sets: lib/notification.js

Issue 29339343: Noissue - Removed redundant URL compatibility logic (Closed)
Left Patch Set: Always use URL Created April 4, 2016, 1:39 p.m.
Right Patch Set: Use hostname Created April 4, 2016, 2:04 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
« no previous file with change/comment | « no previous file | lib/synchronizer.js » ('j') | 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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 continue; 215 continue;
216 } 216 }
217 217
218 if (typeof url === "string" || notification.urlFilters instanceof Array) 218 if (typeof url === "string" || notification.urlFilters instanceof Array)
219 { 219 {
220 if (Prefs.enabled && typeof url === "string" && notification.urlFilters instanceof Array) 220 if (Prefs.enabled && typeof url === "string" && notification.urlFilters instanceof Array)
221 { 221 {
222 let host; 222 let host;
223 try 223 try
224 { 224 {
225 host = new URL(url).host; 225 host = new URL(url).hostname;
Sebastian Noack 2016/04/04 14:05:39 Sorry, I missed that. Before we used the hostname
226 } 226 }
227 catch (e) 227 catch (e)
228 { 228 {
229 host = ""; 229 host = "";
230 } 230 }
231 231
232 let exception = defaultMatcher.matchesAny(url, RegExpFilter.typeMap.DO CUMENT, host, false, null); 232 let exception = defaultMatcher.matchesAny(url, RegExpFilter.typeMap.DO CUMENT, host, false, null);
233 if (exception instanceof WhitelistFilter) 233 if (exception instanceof WhitelistFilter)
234 continue; 234 continue;
235 235
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 Prefs.notifications_showui = true; 398 Prefs.notifications_showui = true;
399 } 399 }
400 else if (index != -1 && forceValue !== true) 400 else if (index != -1 && forceValue !== true)
401 categories.splice(index, 1); 401 categories.splice(index, 1);
402 402
403 // HACK: JSON values aren't saved unless they are assigned a different objec t. 403 // HACK: JSON values aren't saved unless they are assigned a different objec t.
404 Prefs.notifications_ignoredcategories = JSON.parse(JSON.stringify(categories )); 404 Prefs.notifications_ignoredcategories = JSON.parse(JSON.stringify(categories ));
405 } 405 }
406 }; 406 };
407 Notification.init(); 407 Notification.init();
LEFTRIGHT

Powered by Google App Engine
This is Rietveld