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-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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 { | 272 { |
273 errors.push(convertObject(error)); | 273 errors.push(convertObject(["lineno", "reason"], error)); |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 if (errors.length > 0) | 277 if (errors.length > 0) |
278 return errors; | 278 return errors; |
279 | 279 |
280 let seenFilter = Object.create(null); | 280 let seenFilter = Object.create(null); |
281 for (let filter of result.filters) | 281 for (let filter of result.filters) |
282 { | 282 { |
283 FilterStorage.addFilter(filter); | 283 FilterStorage.addFilter(filter); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 if (message.url) | 458 if (message.url) |
459 subscriptions = [Subscription.fromURL(message.url)]; | 459 subscriptions = [Subscription.fromURL(message.url)]; |
460 | 460 |
461 for (let subscription of subscriptions) | 461 for (let subscription of subscriptions) |
462 { | 462 { |
463 if (subscription instanceof DownloadableSubscription) | 463 if (subscription instanceof DownloadableSubscription) |
464 Synchronizer.execute(subscription, true); | 464 Synchronizer.execute(subscription, true); |
465 } | 465 } |
466 }); | 466 }); |
467 })(this); | 467 })(this); |
LEFT | RIGHT |