OLD | NEW |
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 function addAntiAdblockNotification(subscription) | 45 function addAntiAdblockNotification(subscription) |
46 { | 46 { |
47 let urlFilters = []; | 47 let urlFilters = []; |
48 for (let filter of subscription.filters) | 48 for (let filter of subscription.filters) |
49 { | 49 { |
50 if (filter instanceof ActiveFilter) | 50 if (filter instanceof ActiveFilter) |
51 { | 51 { |
52 for (let domain in filter.domains) | 52 for (let domain in filter.domains) |
53 { | 53 { |
54 let urlFilter = "||" + domain + "^"; | 54 let urlFilter = "||" + domain + "^$document"; |
55 if (domain && filter.domains[domain] && urlFilters.indexOf(urlFilter)
== -1) | 55 if (domain && filter.domains[domain] && urlFilters.indexOf(urlFilter)
== -1) |
56 urlFilters.push(urlFilter); | 56 urlFilters.push(urlFilter); |
57 } | 57 } |
58 } | 58 } |
59 } | 59 } |
60 notification.urlFilters = urlFilters; | 60 notification.urlFilters = urlFilters; |
61 Notification.addNotification(notification); | 61 Notification.addNotification(notification); |
62 Notification.addQuestionListener(notification.id, notificationListener); | 62 Notification.addQuestionListener(notification.id, notificationListener); |
63 } | 63 } |
64 | 64 |
(...skipping 11 matching lines...) Expand all Loading... |
76 { | 76 { |
77 if (!/^subscription\.(updated|removed|disabled)$/.test(action) || value.url
!= Prefs.subscriptions_antiadblockurl) | 77 if (!/^subscription\.(updated|removed|disabled)$/.test(action) || value.url
!= Prefs.subscriptions_antiadblockurl) |
78 return; | 78 return; |
79 | 79 |
80 if (action == "subscription.updated") | 80 if (action == "subscription.updated") |
81 addAntiAdblockNotification(value); | 81 addAntiAdblockNotification(value); |
82 else if (action == "subscription.removed" || (action == "subscription.disabl
ed" && !value.disabled)) | 82 else if (action == "subscription.removed" || (action == "subscription.disabl
ed" && !value.disabled)) |
83 removeAntiAdblockNotification(); | 83 removeAntiAdblockNotification(); |
84 }); | 84 }); |
85 } | 85 } |
OLD | NEW |