parent
76e09c7512
commit
582cc9a25a
3 changed files with 38 additions and 2 deletions
@ -0,0 +1,15 @@ |
||||
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:'; |
||||
}); |
||||
}); |
||||
}; |
||||
|
||||
export { getCompletions }; |
Reference in new issue