From c4afd7237b7720acbf642fc4c6eb529420295dcd Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 23 Jul 2018 21:26:47 +0900 Subject: [wip] implement command usecases --- src/background/repositories/bookmark.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/background/repositories/bookmark.js (limited to 'src/background/repositories') diff --git a/src/background/repositories/bookmark.js b/src/background/repositories/bookmark.js new file mode 100644 index 0000000..99f7ec4 --- /dev/null +++ b/src/background/repositories/bookmark.js @@ -0,0 +1,13 @@ +export default class BookmarkRepository { + async create(title, url) { + let item = await browser.bookmarks.create({ + type: 'bookmark', + title, + url, + }); + if (!item) { + throw new Error('Could not create a bookmark'); + } + return item; + } +} -- cgit v1.2.3