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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 { | 168 { |
169 if (params.filterError) | 169 if (params.filterError) |
170 return {error: "Invalid filter"}; | 170 return {error: "Invalid filter"}; |
171 return {filter: modules.filterClasses.Filter.fromText(text)}; | 171 return {filter: modules.filterClasses.Filter.fromText(text)}; |
172 }, | 172 }, |
173 parseFilters: function(text) | 173 parseFilters: function(text) |
174 { | 174 { |
175 if (params.filterError) | 175 if (params.filterError) |
176 return {errors: ["Invalid filter"]}; | 176 return {errors: ["Invalid filter"]}; |
177 return { | 177 return { |
178 filters: text.split("\n").map(modules.filterClasses.Filter.fromText), | 178 filters: text.split("\n") |
| 179 .filter(function(filter) {return !!filter;}) |
| 180 .map(modules.filterClasses.Filter.fromText), |
179 errors: [] | 181 errors: [] |
180 }; | 182 }; |
181 } | 183 } |
182 }; | 184 }; |
183 | 185 |
184 modules.synchronizer = { | 186 modules.synchronizer = { |
185 Synchronizer: {} | 187 Synchronizer: {} |
186 }; | 188 }; |
187 | 189 |
188 modules.matcher = { | 190 modules.matcher = { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 type: "message", | 299 type: "message", |
298 payload: { | 300 payload: { |
299 title: "Custom subscription", | 301 title: "Custom subscription", |
300 url: "http://example.com/custom.txt", | 302 url: "http://example.com/custom.txt", |
301 type: "add-subscription" | 303 type: "add-subscription" |
302 } | 304 } |
303 }, "*"); | 305 }, "*"); |
304 }, 1000); | 306 }, 1000); |
305 } | 307 } |
306 })(this); | 308 })(this); |
OLD | NEW |