aboutsummaryrefslogtreecommitdiff
path: root/src/settings/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/index.js')
-rw-r--r--src/settings/index.js27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/settings/index.js b/src/settings/index.js
index 89a9533..e075385 100644
--- a/src/settings/index.js
+++ b/src/settings/index.js
@@ -1,24 +1,17 @@
import './settings.scss';
-import DefaultSettings from './default-settings';
-let form = document.getElementById('vimvixen-settings-form');
-
-form.addEventListener('submit', (e) => {
- e.preventDefault();
- browser.storage.local.set({
- settings: {
- json: e.target.elements['plain-json'].value
- }
+document.addEventListener('DOMContentLoaded', () => {
+ let form = document.getElementById('vimvixen-settings-form');
+ form.addEventListener('submit', (e) => {
+ e.preventDefault();
+ browser.storage.local.set({
+ settings: {
+ json: e.target.elements['plain-json'].value
+ }
+ });
});
-});
-document.addEventListener('DOMContentLoaded', () => {
browser.storage.local.get('settings').then((value) => {
- if (value.settings.json) {
- form.elements['plain-json'].value = value.settings.json;
- } else {
- form.elements['plain-json'].value =
- JSON.stringify(DefaultSettings, null, 2);
- }
+ form.elements['plain-json'].value = value.settings.json;
}, console.error);
});