diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-17 21:32:05 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-17 21:32:05 +0900 |
commit | 66de4a59d0e3b617b9ba317e77aedb6fb705a1ff (patch) | |
tree | d5d479c5a303bf0b77c96e83025fa17e635041b9 /src/background | |
parent | 49fc34e4444773344e7388fa818dd6e76d825b86 (diff) |
complete histoly simply
Diffstat (limited to 'src/background')
-rw-r--r-- | src/background/histories.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/background/histories.js b/src/background/histories.js new file mode 100644 index 0000000..b276a2d --- /dev/null +++ b/src/background/histories.js @@ -0,0 +1,10 @@ +const getCompletions = (keyword) => { + return browser.history.search({ + text: keyword, + startTime: '1970-01-01' + }).then((items) => { + return items.sort((x, y) => x.lastVisitTime < y.lastVisitTime).slice(0, 10); + }); +}; + +export { getCompletions }; |