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

Delta Between Two Patch Sets: lib/notification.js

Issue 29329604: Issue 3254 - Anti-adblock warning should not show when Adblock Plus is disabled (Closed)
Left Patch Set: Created Nov. 2, 2015, 11:54 a.m.
Right Patch Set: Fixed parameter Created Nov. 2, 2015, 2:10 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 | 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = (typeof URL == "function" ? new URL(url).hostname : Utils.m akeURI(url).host); 222 let host = (typeof URL == "function" ? new URL(url).hostname : Utils.m akeURI(url).host);
223 let exception = defaultMatcher.matchesAny(url, RegExpFilter.typeMap.DO CUMENT, host, false, null); 223 let exception = defaultMatcher.matchesAny(url, RegExpFilter.typeMap.DO CUMENT, host, false, null);
224 if (exception instanceof WhitelistFilter) 224 if (exception instanceof WhitelistFilter)
225 continue; 225 continue;
226 226
227 let matcher = new Matcher(); 227 let matcher = new Matcher();
228 for (let urlFilter of notification.urlFilters) 228 for (let urlFilter of notification.urlFilters)
229 matcher.add(Filter.fromText(urlFilter)); 229 matcher.add(Filter.fromText(urlFilter));
230 if (!matcher.matchesAny(url, RegExpFilter.typeMap.DOCUMENT, null, fals e, null)) 230 if (!matcher.matchesAny(url, RegExpFilter.typeMap.DOCUMENT, host, fals e, null))
Thomas Greiner 2015/11/02 13:59:38 Any reason why you don't pass the domain here like
Wladimir Palant 2015/11/02 14:10:31 No good reason actually, fixed.
231 continue; 231 continue;
232 } 232 }
233 else 233 else
234 continue; 234 continue;
235 } 235 }
236 236
237 if (notification.targets instanceof Array) 237 if (notification.targets instanceof Array)
238 { 238 {
239 let match = false; 239 let match = false;
240 for (let target of notification.targets) 240 for (let target of notification.targets)
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 Prefs.notifications_showui = true; 389 Prefs.notifications_showui = true;
390 } 390 }
391 else if (index != -1 && forceValue !== true) 391 else if (index != -1 && forceValue !== true)
392 categories.splice(index, 1); 392 categories.splice(index, 1);
393 393
394 // HACK: JSON values aren't saved unless they are assigned a different objec t. 394 // HACK: JSON values aren't saved unless they are assigned a different objec t.
395 Prefs.notifications_ignoredcategories = JSON.parse(JSON.stringify(categories )); 395 Prefs.notifications_ignoredcategories = JSON.parse(JSON.stringify(categories ));
396 } 396 }
397 }; 397 };
398 Notification.init(); 398 Notification.init();
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