Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 Loading... | |
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 Loading... | |
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(); |
LEFT | RIGHT |