diff options
Diffstat (limited to 'src/background/repositories')
-rw-r--r-- | src/background/repositories/BookmarkRepository.js (renamed from src/background/repositories/bookmark.js) | 0 | ||||
-rw-r--r-- | src/background/repositories/BrowserSettingRepository.js | 8 | ||||
-rw-r--r-- | src/background/repositories/CompletionsRepository.js (renamed from src/background/repositories/completions.js) | 0 | ||||
-rw-r--r-- | src/background/repositories/FindRepository.js (renamed from src/background/repositories/find.js) | 2 | ||||
-rw-r--r-- | src/background/repositories/MarkRepository.js (renamed from src/background/repositories/mark.js) | 4 | ||||
-rw-r--r-- | src/background/repositories/PersistentSettingRepository.js (renamed from src/background/repositories/persistent-setting.js) | 6 | ||||
-rw-r--r-- | src/background/repositories/SettingRepository.js (renamed from src/background/repositories/setting.js) | 2 | ||||
-rw-r--r-- | src/background/repositories/VersionRepository.js (renamed from src/background/repositories/version.js) | 0 |
8 files changed, 13 insertions, 9 deletions
diff --git a/src/background/repositories/bookmark.js b/src/background/repositories/BookmarkRepository.js index 99f7ec4..99f7ec4 100644 --- a/src/background/repositories/bookmark.js +++ b/src/background/repositories/BookmarkRepository.js diff --git a/src/background/repositories/BrowserSettingRepository.js b/src/background/repositories/BrowserSettingRepository.js new file mode 100644 index 0000000..a9d2c06 --- /dev/null +++ b/src/background/repositories/BrowserSettingRepository.js @@ -0,0 +1,8 @@ +import * as urls from '../../shared/urls'; + +export default class BrowserSettingRepository { + async getHomepageUrls() { + let { value } = await browser.browserSettings.homepageOverride.get({}); + return value.split('|').map(urls.normalizeUrl); + } +} diff --git a/src/background/repositories/completions.js b/src/background/repositories/CompletionsRepository.js index 1318d36..1318d36 100644 --- a/src/background/repositories/completions.js +++ b/src/background/repositories/CompletionsRepository.js diff --git a/src/background/repositories/find.js b/src/background/repositories/FindRepository.js index 6656c58..74ec914 100644 --- a/src/background/repositories/find.js +++ b/src/background/repositories/FindRepository.js @@ -1,4 +1,4 @@ -import MemoryStorage from '../infrastructures/memory-storage'; +import MemoryStorage from '../infrastructures/MemoryStorage'; const FIND_KEYWORD_KEY = 'find-keyword'; diff --git a/src/background/repositories/mark.js b/src/background/repositories/MarkRepository.js index 339a660..282c712 100644 --- a/src/background/repositories/mark.js +++ b/src/background/repositories/MarkRepository.js @@ -1,5 +1,5 @@ -import MemoryStorage from '../infrastructures/memory-storage'; -import GlobalMark from 'background/domains/global-mark'; +import MemoryStorage from '../infrastructures/MemoryStorage'; +import GlobalMark from '../domains/GlobalMark'; const MARK_KEY = 'mark'; diff --git a/src/background/repositories/persistent-setting.js b/src/background/repositories/PersistentSettingRepository.js index 247ea6f..4cab107 100644 --- a/src/background/repositories/persistent-setting.js +++ b/src/background/repositories/PersistentSettingRepository.js @@ -1,10 +1,6 @@ -import Setting from '../domains/setting'; +import Setting from '../domains/Setting'; export default class SettingRepository { - save(settings) { - return browser.storage.local.set({ settings: settings.serialize() }); - } - async load() { let { settings } = await browser.storage.local.get('settings'); if (!settings) { diff --git a/src/background/repositories/setting.js b/src/background/repositories/SettingRepository.js index 6d48525..c4667a9 100644 --- a/src/background/repositories/setting.js +++ b/src/background/repositories/SettingRepository.js @@ -1,4 +1,4 @@ -import MemoryStorage from '../infrastructures/memory-storage'; +import MemoryStorage from '../infrastructures/MemoryStorage'; const CACHED_SETTING_KEY = 'setting'; diff --git a/src/background/repositories/version.js b/src/background/repositories/VersionRepository.js index 4c71d05..4c71d05 100644 --- a/src/background/repositories/version.js +++ b/src/background/repositories/VersionRepository.js |