diff --git a/app/scripts/auto-type/auto-type-filter.js b/app/scripts/auto-type/auto-type-filter.js index 92e2b533..bc155164 100644 --- a/app/scripts/auto-type/auto-type-filter.js +++ b/app/scripts/auto-type/auto-type-filter.js @@ -41,37 +41,44 @@ AutoTypeFilter.prototype.getEntryRank = function(entry) { if (this.titleLower && entry.title) { rank += Ranking.getStringRank(entry.title.toLowerCase(), this.titleLower); } - if (this.urlParts && entry.url) { - const entryUrlParts = urlPartsRegex.exec(entry.url.toLowerCase()); - if (entryUrlParts) { - const [, scheme, domain, path] = entryUrlParts; - const [, thisScheme, thisDomain, thisPath] = this.urlParts; - if (domain === thisDomain || thisDomain.indexOf('.' + domain) > 0) { - if (domain === thisDomain) { - rank += 20; + if (this.urlParts) { + if (entry.url) { + const entryUrlParts = urlPartsRegex.exec(entry.url.toLowerCase()); + if (entryUrlParts) { + const [, scheme, domain, path] = entryUrlParts; + const [, thisScheme, thisDomain, thisPath] = this.urlParts; + if (domain === thisDomain || thisDomain.indexOf('.' + domain) > 0) { + if (domain === thisDomain) { + rank += 20; + } else { + rank += 10; + } + if (path === thisPath) { + rank += 10; + } else if (path && thisPath) { + if (path.lastIndexOf(thisPath, 0) === 0) { + rank += 5; + } else if (thisPath.lastIndexOf(path, 0) === 0) { + rank += 3; + } + } + if (scheme === thisScheme) { + rank += 1; + } } else { - rank += 10; - } - if (path === thisPath) { - rank += 10; - } else if (path && thisPath) { - if (path.lastIndexOf(thisPath, 0) === 0) { + if (entry.searchText.indexOf(this.urlLower) >= 0) { + // the url is in some field; include it rank += 5; - } else if (thisPath.lastIndexOf(path, 0) === 0) { - rank += 3; + } else { + // another domain; don't show this record at all, ignore title match + return 0; } } - if (scheme === thisScheme) { - rank += 1; - } - } else { - if (entry.searchText.indexOf(this.urlLower) >= 0) { - // the url is in some field; include it - rank += 5; - } else { - // another domain; don't show this record at all, ignore title match - return 0; - } + } + } else { + if (entry.searchText.indexOf(this.urlLower) >= 0) { + // the url is in some field; include it + rank += 5; } } } diff --git a/release-notes.md b/release-notes.md index 590ac2c3..e1227b05 100644 --- a/release-notes.md +++ b/release-notes.md @@ -5,6 +5,7 @@ Release notes `-` fixed generator style issues in Firefox `+` option to hide password in the generator `-` fix #1209: copying app information to clipboard +`-` fix #1215: url matching when there's no website field ##### v1.8.2 (2019-04-22) `-` fix #1163: fixed libgconf-2-4 dependency