aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories/BookmarkRepository.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/repositories/BookmarkRepository.js')
-rw-r--r--src/background/repositories/BookmarkRepository.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/background/repositories/BookmarkRepository.js b/src/background/repositories/BookmarkRepository.js
new file mode 100644
index 0000000..99f7ec4
--- /dev/null
+++ b/src/background/repositories/BookmarkRepository.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;
+ }
+}