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 21551 2781ce3e4d00f4a49e1b28400a1981c55a661d96
parent 21550 79d319474891f2ad519d7f60902e2f18d2797c74
child 21552 d49fb2508139b35b456db43c138461e15fdc3f70
push id1305
push usermbanner@mozilla.com
push dateMon, 23 Feb 2015 19:48:12 +0000
treeherdercomm-beta@3ae4f13858fd [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")))