diff options
Diffstat (limited to 'src/background/shared/completions/bookmarks.js')
-rw-r--r-- | src/background/shared/completions/bookmarks.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/background/shared/completions/bookmarks.js b/src/background/shared/completions/bookmarks.js index 1adb350..bd753af 100644 --- a/src/background/shared/completions/bookmarks.js +++ b/src/background/shared/completions/bookmarks.js @@ -1,15 +1,14 @@ -const getCompletions = (keywords) => { - return browser.bookmarks.search({ query: keywords }).then((items) => { - return items.filter((item) => { - let url = undefined; - try { - url = new URL(item.url); - } catch (e) { - return false; - } - return item.type === 'bookmark' && url.protocol !== 'place:'; - }).slice(0, 10); - }); +const getCompletions = async(keywords) => { + let items = await browser.bookmarks.search({ query: keywords }); + return items.filter((item) => { + let url = undefined; + try { + url = new URL(item.url); + } catch (e) { + return false; + } + return item.type === 'bookmark' && url.protocol !== 'place:'; + }).slice(0, 10); }; export { getCompletions }; |