aboutsummaryrefslogtreecommitdiff
path: root/src/background/repositories/BrowserSettingRepository.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/repositories/BrowserSettingRepository.ts')
-rw-r--r--src/background/repositories/BrowserSettingRepository.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/background/repositories/BrowserSettingRepository.ts b/src/background/repositories/BrowserSettingRepository.ts
new file mode 100644
index 0000000..33b35dd
--- /dev/null
+++ b/src/background/repositories/BrowserSettingRepository.ts
@@ -0,0 +1,24 @@
+import * as urls from '../../shared/urls';
+
+declare namespace browser.browserSettings.homepageOverride {
+
+ type BrowserSettings = {
+ value: string;
+ levelOfControl: LevelOfControlType;
+ };
+
+ type LevelOfControlType =
+ 'not_controllable' |
+ 'controlled_by_other_extensions' |
+ 'controllable_by_this_extension' |
+ 'controlled_by_this_extension';
+
+ function get(param: object): Promise<BrowserSettings>;
+}
+
+export default class BrowserSettingRepository {
+ async getHomepageUrls(): Promise<string[]> {
+ let { value } = await browser.browserSettings.homepageOverride.get({});
+ return value.split('|').map(urls.normalizeUrl);
+ }
+}