Bug 1116446 - Part 1: Support jsonlz4 format for restore in bookmarksManager.js. r=Neil a=IanN for comm-aurora comm-beta CLOSED TREE
authorTooru Fujisawa <arai_a@mac.com>
Wed, 31 Dec 2014 01:39:27 +0900
changeset 25632 5b15f41fa855b8380f1e0008d3b58b7844dd7cc5
parent 25631 5ea55acdc560a99d47a9859034245d6a898e33d4
child 25633 f611e79f87d6d3c551fbb298aab75f31aa4d202e
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil, IanN
bugs1116446
Bug 1116446 - Part 1: Support jsonlz4 format for restore in bookmarksManager.js. r=Neil a=IanN for comm-aurora comm-beta CLOSED TREE
suite/common/bookmarks/bookmarksManager.js
--- a/suite/common/bookmarks/bookmarksManager.js
+++ b/suite/common/bookmarks/bookmarksManager.js
@@ -416,17 +416,17 @@ var PlacesOrganizer = {
       this.restoreBookmarksFromFile(fp.file);
   },
 
   /**
    * Restores bookmarks from a JSON file.
    */
   restoreBookmarksFromFile: function PO_restoreBookmarksFromFile(aFile) {
     // check file extension
-    if (!aFile.leafName.match(/\.json$/)) {
+    if (!/\.json(?:lz4)?$/.test(aFile.leafName)) {
       this._showErrorAlert(PlacesUIUtils.getString("bookmarksRestoreFormatError"));
       return;
     }
 
     // confirm ok to delete existing bookmarks
     if (!Services.prompt.confirm(null,
                                  PlacesUIUtils.getString("bookmarksRestoreAlertTitle"),
                                  PlacesUIUtils.getString("bookmarksRestoreAlert")))