mirror of https://github.com/keeweb/keeweb.git
variables for url parts
This commit is contained in:
parent
ef44bd95d7
commit
9f21842a68
|
@ -47,21 +47,20 @@ AutoTypeFilter.prototype.getEntryRank = function(entry) {
|
|||
if (this.urlParts && entry.url) {
|
||||
const entryUrlParts = urlPartsRegex.exec(entry.url.toLowerCase());
|
||||
if (entryUrlParts) {
|
||||
// domain
|
||||
if (entryUrlParts[2] === this.urlParts[2]) {
|
||||
const [, scheme, domain, path] = entryUrlParts;
|
||||
const [, thisScheme, thisDomain, thisPath] = entryUrlParts;
|
||||
if (domain === thisDomain) {
|
||||
rank += 10;
|
||||
// path
|
||||
if (entryUrlParts[3] === this.urlParts[3]) {
|
||||
if (path === thisPath) {
|
||||
rank += 10;
|
||||
} else if (entryUrlParts[3] && this.urlParts[3]) {
|
||||
if (entryUrlParts[3].lastIndexOf(this.urlParts[3], 0) === 0) {
|
||||
} else if (path && thisPath) {
|
||||
if (path.lastIndexOf(thisPath, 0) === 0) {
|
||||
rank += 5;
|
||||
} else if (this.urlParts.lastIndexOf(entryUrlParts[3], 0) === 0) {
|
||||
} else if (thisPath.lastIndexOf(path, 0) === 0) {
|
||||
rank += 3;
|
||||
}
|
||||
}
|
||||
// scheme
|
||||
if (entryUrlParts[1] === this.urlParts[1]) {
|
||||
if (scheme === thisScheme) {
|
||||
rank += 1;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue