code: function canonicalUrl(search) {
    var canon = canonical();
    if (canon) return includes('?', canon) ? canon : canon + search;
    var url = window.location.href;
    var i = url.indexOf('#');
    return i === -1 ? url : url.slice(0, i);
  }
docs: Return the canonical URL for the page concat the given `search`
  and strip the hash.
  
  @param {string} search
  @return {string}