aboutsummaryrefslogtreecommitdiff
path: root/src/background
diff options
context:
space:
mode:
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 };