aboutsummaryrefslogtreecommitdiff
path: root/src/background
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-09-17 21:32:05 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-09-17 21:32:05 +0900
commit66de4a59d0e3b617b9ba317e77aedb6fb705a1ff (patch)
treed5d479c5a303bf0b77c96e83025fa17e635041b9 /src/background
parent49fc34e4444773344e7388fa818dd6e76d825b86 (diff)
complete histoly simply
Diffstat (limited to 'src/background')
-rw-r--r--src/background/histories.js10
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 };