From 720474858f2f52ad62934b43c346b49165c461ac Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 28 Oct 2017 15:35:39 +0100 Subject: Add backup/restore for Vimium options. See the *very* bottom of the options page (below advanced settings). Clicking "Backup" creates a JSON file. Selecting a backup populates the options inputs, the user then clicks *Save Changes* to confirm. --- lib/settings.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/settings.coffee b/lib/settings.coffee index 11cf7557..fd1ef268 100644 --- a/lib/settings.coffee +++ b/lib/settings.coffee @@ -202,7 +202,7 @@ Settings.init() # Perform migration from old settings versions, if this is the background page. if Utils.isBackgroundPage() - Settings.onLoaded -> + Settings.applyMigrations = -> unless Settings.get "settingsVersion" # This is a new install. For some settings, we retain a legacy default behaviour for existing users but # use a non-default behaviour for new users. @@ -218,6 +218,8 @@ if Utils.isBackgroundPage() # be removed after 1.58 has been out for sufficiently long. Settings.nuke "copyNonDefaultsToChromeStorage-20150717" + Settings.onLoaded Settings.applyMigrations.bind Settings + root = exports ? (window.root ?= {}) root.Settings = Settings extend window, root unless exports? -- cgit v1.2.3