function readSettingsFromDomAndPersist() {
  const optionsEl = dom.find('.section--options');
  // Save settings when options page is closed.
  const backend = dom.find('.options__backend input:checked').value;
  const locale = dom.find('select.options__locales').value;
  const checkboxes = optionsEl.querySelectorAll('.options__categories input:checked');
  const selectedCategories = Array.from(checkboxes).map(input => input.value);
  const device = dom.find('input[name="device"]:checked').value;

  const settings = {
    backend,
    locale,
    selectedCategories,
    device,
  };
  SettingsController.saveSettings(settings);
  return settings;
}
Create the settings from the state of the options form, save in storage, and return it.
@return {SettingsController.Settings}