B2G/gecko/browser/components/thumbnails/PageThumbsProtocol.js
/**
 * Parses a given URI and extracts all parameters relevant to this protocol.
 * @param aURI The URI to parse.
 * @return The parsed parameters.
 */
Parses a given URI and extracts all parameters relevant to this protocol.
@param aURI The URI to parse.
@return The parsed parameters.
Parses a given URI and extracts all parameters relevant to this protocol . @param aURI The URI to parse . @return The parsed parameters .
function parseURI(aURI) {
  let {scheme, staticHost} = PageThumbs;
  let re = new RegExp("^" + scheme + "://" + staticHost + ".*?\\?");
  let query = aURI.spec.replace(re, "");
  let params = {};
  query.split("&").forEach(function (aParam) {
    let [key, value] = aParam.split("=").map(decodeURIComponent);
    params[key.toLowerCase()] = value;
  });
  return params;
}
function parseURI ( aURI ) { let { scheme , staticHost } = PageThumbs ; let re = new RegExp ( "^" + scheme + "://" + staticHost + ".*?\\?" ) ; let query = aURI . spec . replace ( re , "" ) ; let params = { } ; query . split ( "&" ) . forEach ( function ( aParam ) { let [ key , value ] = aParam . split ( "=" ) . map ( decodeURIComponent ) ; params [ key . toLowerCase ( ) ] = value ; } ) ; return params ; }
Parses a given URI and extracts all parameters relevant to this protocol.
Parses a given URI and extracts all parameters relevant to this protocol .