| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 if (!headerMatch) | 150 if (!headerMatch) |
| 151 return errorCallback("synchronize_invalid_data"); | 151 return errorCallback("synchronize_invalid_data"); |
| 152 let minVersion = headerMatch[1]; | 152 let minVersion = headerMatch[1]; |
| 153 | 153 |
| 154 let parser = DownloadableSubscription.parseDownload(); | 154 let parser = DownloadableSubscription.parseDownload(); |
| 155 | 155 |
| 156 // Process filters | 156 // Process filters |
| 157 for (let line of lines) | 157 for (let line of lines) |
| 158 parser.process(line); | 158 parser.process(line); |
| 159 | 159 |
| 160 if (!parser.verifyChecksum()) | |
| 161 return errorCallback("synchronize_checksum_mismatch"); | |
| 162 | |
| 163 if (parser.redirect) | 160 if (parser.redirect) |
| 164 { | 161 { |
| 165 let {redirect} = parser; | 162 let {redirect} = parser; |
| 166 parser.delete(); | 163 parser.delete(); |
| 167 return redirectCallback(redirect); | 164 return redirectCallback(redirect); |
| 168 } | 165 } |
| 169 | 166 |
| 170 // Handle redirects | 167 // Handle redirects |
| 171 let subscription = Subscription.fromURL(downloadable.redirectURL || | 168 let subscription = Subscription.fromURL(downloadable.redirectURL || |
| 172 downloadable.url); | 169 downloadable.url); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 Array.from(subscription.filters, f => f.text).join("\n"); | 290 Array.from(subscription.filters, f => f.text).join("\n"); |
| 294 redirectCallback("data:text/plain," + encodeURIComponent(data)); | 291 redirectCallback("data:text/plain," + encodeURIComponent(data)); |
| 295 } | 292 } |
| 296 }, false); | 293 }, false); |
| 297 request.send(null); | 294 request.send(null); |
| 298 } | 295 } |
| 299 } | 296 } |
| 300 } | 297 } |
| 301 }; | 298 }; |
| 302 Synchronizer.init(); | 299 Synchronizer.init(); |
| LEFT | RIGHT |