aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories/bookmark.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/repositories/bookmark.js')
-rw-r--r--src/background/repositories/bookmark.js13
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;
+ }
+}