From 66de4a59d0e3b617b9ba317e77aedb6fb705a1ff Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 17 Sep 2017 21:32:05 +0900 Subject: complete histoly simply --- src/background/histories.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/background/histories.js (limited to 'src/background') 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 }; -- cgit v1.2.3