 DomUtils?.documentReady ->
   $("backupButton").addEventListener "click", ->
     document.activeElement?.blur()
-    backup = {}
+    backup = settingsVersion: bgSettings.get "settingsVersion"
     for option in Option.all
       backup[option.field] = option.readValueFromElement()
     # Create the blob in the background page so it isn't garbage collected when the page closes in FF.

  # Static method.
  @saveOptions: ->
    Option.all.map (option) -> option.save()
    # We need to apply migrations in case we are restoring an old backup.
    bgSettings.applyMigrations()


          alert "Failed to parse Vimium backup."
          return

        restoreSettingsVersion = backup["settingsVersion"] if "settingsVersion" of backup
        for option in Option.all
          if option.field of backup
            option.populateElement backup[option.field]
