Open URLs from bookmarks

This commit is contained in:
Shin'ya Ueoka 2018-05-07 20:53:00 +09:00
parent 76e09c7512
commit 582cc9a25a
3 changed files with 38 additions and 2 deletions

View file

@ -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 };