diff options
| author | Stephen Blott | 2015-06-20 07:16:01 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2015-06-20 07:24:21 +0100 | 
| commit | 46e19df644b4b7e4040f1d8cee33116d9b900f0d (patch) | |
| tree | 4dfa3fb32f07601b5f386f0f5ab2340d679d0f25 /lib | |
| parent | 84150641a236b30fe5f9c36a0249dbba54dc6166 (diff) | |
| download | vimium-46e19df644b4b7e4040f1d8cee33116d9b900f0d.tar.bz2 | |
Document options/settings data model.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/settings.coffee | 13 | 
1 files changed, 12 insertions, 1 deletions
| diff --git a/lib/settings.coffee b/lib/settings.coffee index f0cf30f1..ca6cef89 100644 --- a/lib/settings.coffee +++ b/lib/settings.coffee @@ -1,4 +1,15 @@ +# A "setting" is a stored key/value pair.  An "option" is setting which has a default value and whose value +# can be changed on the options page. +# +# Option values which have never been changed by the user are in Settings.defaults. +# +# Settings whose values have been changed are: +# 1. stored either in chrome.storage.sync or in chrome.storage.local (but never both), and +# 2. cached in Settings.cache; on extension pages, Settings.cache uses localStorage (so it persists). +# +# In all cases except Settings.defaults, values are stored as jsonified strings. +  Settings =    storage: chrome.storage.sync    cache: {} @@ -159,7 +170,7 @@ if Utils.isBackgroundPage()        chrome.storage.local.set findModeRawQueryList: (if rawQuery then [ rawQuery ] else [])    # Migration (after 1.51, 2015/6/17). -  # Copy settings with non-default values (and which are not in synced storage) to chrome.storage.local; +  # Copy options with non-default values (and which are not in synced storage) to chrome.storage.local;    # thereby making these settings accessible within content scripts.    do (migrationKey = "copyNonDefaultsToChromeStorage-20150717") ->      unless localStorage[migrationKey] | 
