This repository has been archived on 2020-04-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Vim-Vixen/src/background/repositories/BookmarkRepository.ts
2019-05-02 11:14:19 +09:00

13 lines
275 B
TypeScript

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;
}
}