diff --git a/extension/src/config-page.js b/extension/src/config-page.js
index 8fa1796..d9caec4 100644
--- a/extension/src/config-page.js
+++ b/extension/src/config-page.js
@@ -1,12 +1,16 @@
(async function() {
- const rejectCheckbox = document.querySelector('#enable-reject');
- chrome.storage.sync.get('enable_reject', (data) => {
- rejectCheckbox.checked = data.enable_reject;
- });
- rejectCheckbox.addEventListener('change', async function() {
- await chrome.storage.sync.set({
- enable_reject: rejectCheckbox.checked,
+ function initCheckbox(selector, configName) {
+ const checkbox = document.querySelector(selector);
+ chrome.storage.sync.get(configName, (data) => {
+ checkbox.checked = data[configName];
});
- });
- rejectCheckbox.disabled = false;
+ checkbox.addEventListener('change', async function() {
+ conf = {}
+ conf[configName] = checkbox.checked;
+ await chrome.storage.sync.set(conf);
+ });
+ checkbox.disabled = false;
+ }
+ initCheckbox('#enable-reject', 'enable_reject');
+ initCheckbox('#enable-shrine', 'enable_shrine');
})();
diff --git a/extension/src/config.html b/extension/src/config.html
index 043366a..7e37ec7 100644
--- a/extension/src/config.html
+++ b/extension/src/config.html
@@ -16,6 +16,13 @@
Enable fetching codes from rejectdopamine.com (3rd party service)
+
+
+
+