aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories/BookmarkRepository.ts
blob: 99f7ec4f08fedc11b5c9d9bed68f24e46ca97a36 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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;
  }
}