B2G/gecko/browser/components/places/content/controller.js
/**
   * Extract the first accepted flavor from a list of flavors.
   * @param aFlavors
   *        The flavors list of type nsIDOMDOMStringList.
   */
Extract the first accepted flavor from a list of flavors.
@param aFlavors
The flavors list of type nsIDOMDOMStringList.
Extract the first accepted flavor from a list of flavors . @param aFlavors The flavors list of type nsIDOMDOMStringList .
function PCDH_getFirstValidFlavor(aFlavors) {
    for (let i = 0; i < aFlavors.length; i++) {
      if (this.GENERIC_VIEW_DROP_TYPES.indexOf(aFlavors[i]) != -1)
        return aFlavors[i];
    }
    if (aFlavors.contains("text/plain")) {
        return PlacesUtils.TYPE_UNICODE;
    }
    return null;
  }
function PCDH_getFirstValidFlavor ( aFlavors ) { for ( let i = 0 ; i < aFlavors . length ; i ++ ) { if ( this . GENERIC_VIEW_DROP_TYPES . indexOf ( aFlavors [ i ] ) != - 1 ) return aFlavors [ i ] ; } if ( aFlavors . contains ( "text/plain" ) ) { return PlacesUtils . TYPE_UNICODE ; } return null ; }
Extract the first accepted flavor from a list of flavors.
Extract the first accepted flavor from a list of flavors .
// If no supported flavor is found, check if data includes text/plain  // contents.  If so, request them as text/unicode, a conversion will happen  // automatically.