code: function getCanonicalUrl(url) {
    // Trim the #fragment. We are unique to query string, though.
    var hashIndex = url.indexOf('#');
    if (hashIndex != -1) {
      url = url.substring(0, hashIndex);
    }
    return url;
  }
docs: Canonicalizes a URL so that it can be matched against.
  @param {string} url URL.
  @return {string} Canonical URL.