B2G/gecko/browser/components/places/content/places.js
/**
   * Open a file-picker and import the selected file into the bookmarks store
   */
Open a file-picker and import the selected file into the bookmarks store
Open a file - picker and import the selected file into the bookmarks store
function PO_importFromFile() {
    let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
    let fpCallback = function fpCallback_done(aResult) {
      if (aResult != Ci.nsIFilePicker.returnCancel && fp.fileURL) {
        Components.utils.import("resource://gre/modules/BookmarkHTMLUtils.jsm");
        BookmarkHTMLUtils.importFromURL(fp.fileURL.spec, false);
      }
    };
    fp.init(window, PlacesUIUtils.getString("SelectImport"),
            Ci.nsIFilePicker.modeOpen);
    fp.appendFilters(Ci.nsIFilePicker.filterHTML);
    fp.open(fpCallback);
  }
function PO_importFromFile ( ) { let fp = Cc [ "@mozilla.org/filepicker;1" ] . createInstance ( Ci . nsIFilePicker ) ; let fpCallback = function fpCallback_done ( aResult ) { if ( aResult != Ci . nsIFilePicker . returnCancel && fp . fileURL ) { Components . utils . import ( "resource://gre/modules/BookmarkHTMLUtils.jsm" ) ; BookmarkHTMLUtils . importFromURL ( fp . fileURL . spec , false ) ; } } ; fp . init ( window , PlacesUIUtils . getString ( "SelectImport" ) , Ci . nsIFilePicker . modeOpen ) ; fp . appendFilters ( Ci . nsIFilePicker . filterHTML ) ; fp . open ( fpCallback ) ; }
Open a file-picker and import the selected file into the bookmarks store
Open a file - picker and import the selected file into the bookmarks store