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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 return subscription.filters.map(convertFilter); | 262 return subscription.filters.map(convertFilter); |
263 }); | 263 }); |
264 | 264 |
265 port.on("filters.importRaw", (message, sender) => | 265 port.on("filters.importRaw", (message, sender) => |
266 { | 266 { |
267 let result = require("filterValidation").parseFilters(message.text); | 267 let result = require("filterValidation").parseFilters(message.text); |
268 let errors = []; | 268 let errors = []; |
269 for (let error of result.errors) | 269 for (let error of result.errors) |
270 { | 270 { |
271 if (error.type != "unexpected-filter-list-header") | 271 if (error.type != "unexpected-filter-list-header") |
272 errors.push(error.toString()); | 272 { |
| 273 errors.push(convertObject(error)); |
| 274 } |
273 } | 275 } |
274 | 276 |
275 if (errors.length > 0) | 277 if (errors.length > 0) |
276 return errors; | 278 return errors; |
277 | 279 |
278 let seenFilter = Object.create(null); | 280 let seenFilter = Object.create(null); |
279 for (let filter of result.filters) | 281 for (let filter of result.filters) |
280 { | 282 { |
281 FilterStorage.addFilter(filter); | 283 FilterStorage.addFilter(filter); |
282 seenFilter[filter.text] = null; | 284 seenFilter[filter.text] = null; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 if (message.url) | 458 if (message.url) |
457 subscriptions = [Subscription.fromURL(message.url)]; | 459 subscriptions = [Subscription.fromURL(message.url)]; |
458 | 460 |
459 for (let subscription of subscriptions) | 461 for (let subscription of subscriptions) |
460 { | 462 { |
461 if (subscription instanceof DownloadableSubscription) | 463 if (subscription instanceof DownloadableSubscription) |
462 Synchronizer.execute(subscription, true); | 464 Synchronizer.execute(subscription, true); |
463 } | 465 } |
464 }); | 466 }); |
465 })(this); | 467 })(this); |
OLD | NEW |