OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 return; | 304 return; |
305 | 305 |
306 if (!(subscription.url in FilterStorage.knownSubscriptions)) | 306 if (!(subscription.url in FilterStorage.knownSubscriptions)) |
307 return; | 307 return; |
308 | 308 |
309 let match = /^(\d+)(?:\s+(\S+))?$/.exec(request.responseText); | 309 let match = /^(\d+)(?:\s+(\S+))?$/.exec(request.responseText); |
310 if (match && match[1] == "301" && match[2] && /^https?:\/\//i.test(mat
ch[2])) // Moved permanently | 310 if (match && match[1] == "301" && match[2] && /^https?:\/\//i.test(mat
ch[2])) // Moved permanently |
311 redirectCallback(match[2]); | 311 redirectCallback(match[2]); |
312 else if (match && match[1] == "410") // Gone | 312 else if (match && match[1] == "410") // Gone |
313 { | 313 { |
314 let data = "[Adblock]\n" + subscription.filters.map(function(f) f.te
xt).join("\n"); | 314 let data = "[Adblock]\n" + subscription.filters.map((f) => f.text).j
oin("\n"); |
315 redirectCallback("data:text/plain," + encodeURIComponent(data)); | 315 redirectCallback("data:text/plain," + encodeURIComponent(data)); |
316 } | 316 } |
317 }, false); | 317 }, false); |
318 request.send(null); | 318 request.send(null); |
319 } | 319 } |
320 } | 320 } |
321 }, | 321 }, |
322 }; | 322 }; |
323 Synchronizer.init(); | 323 Synchronizer.init(); |
OLD | NEW |