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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // Skip checksums | 306 // Skip checksums |
307 if (filter instanceof CommentFilter && this.CHECKSUM_REGEXP.test(filter.
text)) | 307 if (filter instanceof CommentFilter && this.CHECKSUM_REGEXP.test(filter.
text)) |
308 continue; | 308 continue; |
309 // Skip group headers | 309 // Skip group headers |
310 if (filter instanceof CommentFilter && this.GROUPTITLE_REGEXP.test(filte
r.text)) | 310 if (filter instanceof CommentFilter && this.GROUPTITLE_REGEXP.test(filte
r.text)) |
311 continue; | 311 continue; |
312 list.push(filter.text); | 312 list.push(filter.text); |
313 | 313 |
314 if (filter instanceof ElemHideException && Services.vc.compare(minVersio
n, "2.1") < 0) | 314 if (filter instanceof ElemHideException && Services.vc.compare(minVersio
n, "2.1") < 0) |
315 minVersion = "2.1"; | 315 minVersion = "2.1"; |
| 316 |
| 317 if (filter instanceof RegExpFilter && filter.contentType & (RegExpFilter
.typeMap.GENERICHIDE | RegExpFilter.typeMap.GENERICBLOCK) && Services.vc.compare
(minVersion, "2.6.12") < 0) |
| 318 minVersion = "2.6.12"; |
316 } | 319 } |
317 } | 320 } |
318 list.unshift("[Adblock Plus " + minVersion + "]"); | 321 list.unshift("[Adblock Plus " + minVersion + "]"); |
319 | 322 |
320 // Insert checksum. Have to add an empty line to the end of the list to | 323 // Insert checksum. Have to add an empty line to the end of the list to |
321 // account for the trailing newline in the file. | 324 // account for the trailing newline in the file. |
322 list.push(""); | 325 list.push(""); |
323 let checksum = Utils.generateChecksum(list); | 326 let checksum = Utils.generateChecksum(list); |
324 list.pop(); | 327 list.pop(); |
325 if (checksum) | 328 if (checksum) |
326 list.splice(1, 0, "! Checksum: " + checksum); | 329 list.splice(1, 0, "! Checksum: " + checksum); |
327 | 330 |
328 IO.writeToFile(file, list, function(e) | 331 IO.writeToFile(file, list, function(e) |
329 { | 332 { |
330 if (e) | 333 if (e) |
331 { | 334 { |
332 Cu.reportError(e); | 335 Cu.reportError(e); |
333 Utils.alert(window, E("backupButton").getAttribute("_backupError"), E("b
ackupButton").getAttribute("_backupDialogTitle")); | 336 Utils.alert(window, E("backupButton").getAttribute("_backupError"), E("b
ackupButton").getAttribute("_backupDialogTitle")); |
334 } | 337 } |
335 }); | 338 }); |
336 } | 339 } |
337 }; | 340 }; |
338 | 341 |
339 window.addEventListener("load", function() | 342 window.addEventListener("load", function() |
340 { | 343 { |
341 Backup.init(); | 344 Backup.init(); |
342 }, false); | 345 }, false); |
OLD | NEW |