Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: chrome/content/ui/filters-backup.js

Issue 29357587: Issue 4538 - When exporting filters, mark $websocket filters as requiring Adblock Plus 2.8 (Closed) Base URL: https://hg.adblockplus.org/adblockplus
Patch Set: Created Oct. 17, 2016, 11:18 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 316
317 if (filter instanceof RegExpFilter && filter.contentType & (RegExpFilter .typeMap.GENERICHIDE | RegExpFilter.typeMap.GENERICBLOCK) && Services.vc.compare (minVersion, "2.6.12") < 0) 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"; 318 minVersion = "2.6.12";
319 319
320 if (filter instanceof CSSPropertyFilter && Services.vc.compare(minVersio n, "2.7.3") < 0) 320 if (filter instanceof CSSPropertyFilter && Services.vc.compare(minVersio n, "2.7.3") < 0)
321 minVersion = "2.7.3"; 321 minVersion = "2.7.3";
322
323 if (filter instanceof RegExpFilter &&
324 (filter.contentType & RegExpFilter.typeMap.WEBSOCKET) &&
325 Services.vc.compare(minVersion, "2.8"))
326 {
327 minVersion = "2.8";
328 }
322 } 329 }
323 } 330 }
324 list.unshift("[Adblock Plus " + minVersion + "]"); 331 list.unshift("[Adblock Plus " + minVersion + "]");
325 332
326 // Insert checksum. Have to add an empty line to the end of the list to 333 // Insert checksum. Have to add an empty line to the end of the list to
327 // account for the trailing newline in the file. 334 // account for the trailing newline in the file.
328 list.push(""); 335 list.push("");
329 let checksum = Utils.generateChecksum(list); 336 let checksum = Utils.generateChecksum(list);
330 list.pop(); 337 list.pop();
331 if (checksum) 338 if (checksum)
332 list.splice(1, 0, "! Checksum: " + checksum); 339 list.splice(1, 0, "! Checksum: " + checksum);
333 340
334 IO.writeToFile(file, list, function(e) 341 IO.writeToFile(file, list, function(e)
335 { 342 {
336 if (e) 343 if (e)
337 { 344 {
338 Cu.reportError(e); 345 Cu.reportError(e);
339 Utils.alert(window, E("backupButton").getAttribute("_backupError"), E("b ackupButton").getAttribute("_backupDialogTitle")); 346 Utils.alert(window, E("backupButton").getAttribute("_backupError"), E("b ackupButton").getAttribute("_backupDialogTitle"));
340 } 347 }
341 }); 348 });
342 } 349 }
343 }; 350 };
344 351
345 window.addEventListener("load", function() 352 window.addEventListener("load", function()
346 { 353 {
347 Backup.init(); 354 Backup.init();
348 }, false); 355 }, false);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld