diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-07-23 21:26:47 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-07-26 21:59:05 +0900 |
commit | c4afd7237b7720acbf642fc4c6eb529420295dcd (patch) | |
tree | 1e251d23b8549937c0a3b00f020565b36a412cb3 /src/background/repositories | |
parent | 0846587baf8ff04d2183985a61f14ccdea7263d3 (diff) |
[wip] implement command usecases
Diffstat (limited to 'src/background/repositories')
-rw-r--r-- | src/background/repositories/bookmark.js | 13 |
1 files changed, 13 insertions, 0 deletions
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; + } +} |