B2G/gecko/browser/components/places/content/places.js
/**
   * Backup bookmarks to desktop, auto-generate a filename with a date.
   * The file is a JSON serialization of bookmarks, tags and any annotations
   * of those items.
   */
Backup bookmarks to desktop, auto-generate a filename with a date.
The file is a JSON serialization of bookmarks, tags and any annotations
of those items.
Backup bookmarks to desktop auto - generate a filename with a date . The file is a JSON serialization of bookmarks tags and any annotations of those items .
function PO_backupBookmarks() {
    let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
                 getService(Ci.nsIProperties);
    let backupsDir = dirSvc.get("Desk", Ci.nsILocalFile);
    let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
    let fpCallback = function fpCallback_done(aResult) {
      if (aResult != Ci.nsIFilePicker.returnCancel) {
        PlacesUtils.backups.saveBookmarksToJSONFile(fp.file);
      }
    };
    fp.init(window, PlacesUIUtils.getString("bookmarksBackupTitle"),
            Ci.nsIFilePicker.modeSave);
    fp.appendFilter(PlacesUIUtils.getString("bookmarksRestoreFilterName"),
                    PlacesUIUtils.getString("bookmarksRestoreFilterExtension"));
    fp.defaultString = PlacesUtils.backups.getFilenameForDate();
    fp.displayDirectory = backupsDir;
    fp.open(fpCallback);
  }
function PO_backupBookmarks ( ) { let dirSvc = Cc [ "@mozilla.org/file/directory_service;1" ] . getService ( Ci . nsIProperties ) ; let backupsDir = dirSvc . get ( "Desk" , Ci . nsILocalFile ) ; let fp = Cc [ "@mozilla.org/filepicker;1" ] . createInstance ( Ci . nsIFilePicker ) ; let fpCallback = function fpCallback_done ( aResult ) { if ( aResult != Ci . nsIFilePicker . returnCancel ) { PlacesUtils . backups . saveBookmarksToJSONFile ( fp . file ) ; } } ; fp . init ( window , PlacesUIUtils . getString ( "bookmarksBackupTitle" ) , Ci . nsIFilePicker . modeSave ) ; fp . appendFilter ( PlacesUIUtils . getString ( "bookmarksRestoreFilterName" ) , PlacesUIUtils . getString ( "bookmarksRestoreFilterExtension" ) ) ; fp . defaultString = PlacesUtils . backups . getFilenameForDate ( ) ; fp . displayDirectory = backupsDir ; fp . open ( fpCallback ) ; }
Backup bookmarks to desktop, auto-generate a filename with a date.
Backup bookmarks to desktop auto - generate a filename with a date .