diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-18 00:16:12 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-18 00:17:26 +0900 |
commit | 5d13818fb4128a2b3a511da4929acb26e4f1e872 (patch) | |
tree | 85f7cf59dd3829fa643198cfbe94c8b237040236 /src/background/histories.js | |
parent | 43cf68b65be01d2f40f2cd3df403f06640e55839 (diff) |
use shortest link on suggestion filter
Diffstat (limited to 'src/background/histories.js')
-rw-r--r-- | src/background/histories.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/background/histories.js b/src/background/histories.js index 3136900..42f7fd1 100644 --- a/src/background/histories.js +++ b/src/background/histories.js @@ -18,7 +18,7 @@ const reduceByPathname = (items, min) => { let pathname = item[1].origin + item[1].pathname; if (!hash[pathname]) { hash[pathname] = item; - } else if (hash[pathname][1].visitCount < item[1].visitCount) { + } else if (hash[pathname][1].href.length > item[1].href.length) { hash[pathname] = item; } } @@ -35,7 +35,7 @@ const reduceByOrigin = (items, min) => { let origin = item[1].origin; if (!hash[origin]) { hash[origin] = item; - } else if (hash[origin][1].visitCount < item[1].visitCount) { + } else if (hash[origin][1].href.length > item[1].href.length) { hash[origin] = item; } } @@ -46,7 +46,6 @@ const reduceByOrigin = (items, min) => { return filtered; }; - const getCompletions = (keyword) => { return browser.history.search({ text: keyword, |