Skip to content

Managed hiddenSettings lost in exported backup #3940

@usfbih8u

Description

@usfbih8u

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is NOT a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

This is in Firefox+Linux

I partially succeeded in recovering the uBlock configuration from a manual backup by using policies.json and setting adminSettings and advancedSettings with the data from the backup.

The `code` for anyone that it is interested
#!/bin/bash

readonly backup="ublock-config.txt"
cat << EOF | jq > policies.json
{
  "policies": {
    "ExtensionSettings": {
      "uBlock0@raymondhill.net": {
        "installation_mode": "normal_installed",
        "install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"
      }
    },
    "3rdparty": {
      "Extensions": {
        "uBlock0@raymondhill.net": {
          "adminSettings": $(cat "$backup"),
          "advancedSettings": $(jq '.hiddenSettings | to_entries | map([.key, (.value|tostring)])' "$backup")
        }
      }
    }
  }
}
EOF

The method I use to check that it works is to back up the extension again and make a diff with the original backup. Then I notice hiddenSettings is an empty JSON object, even after applying advancedSettings.

I know that adminSettings cannot set hiddenSettings (that would be nice). The issue is that advancedSettings sets the values correctly, but they appear in the "I am an advanced user" gear list in gray (only those). I don't know whether this means the values were set by an admin or there is some other issue.

In my main profile, the one the backup comes from, the hiddenSettings keys are a bright purple and the values are bright white. I believe those hiddenSettings come from an old backup that’s been carried forward and manually backed up for years.

I would like to preserve those hiddenSettings in backups for a managed uBlock instance so that the information isn't lost in future backups.

Off-topic: Automatic backups when something changes in the profile (settings applied or a lock set in the UI) to a specified path would be awesome for keeping backups automatically in sync with the extension’s current state.

A specific URL where the issue occurs.

moz-extension://{YOUR-EXTENSION-ID}/advanced-settings.html

Steps to Reproduce

  1. Back up the extension.
  2. Generate the policies.json with the bash code provided in the "spoiler" (it works, the values are correctly applied; you can set your own values).
  3. Create a new Firefox profile and open it.
  4. Let the extension fully install.
  5. Back up the extension.
  6. diff the two backups.

diff old new:

2c2
<   "timeStamp": 1770607160348,
---
>   "timeStamp": 1770758486123,
31,36c31
<   "hiddenSettings": {
<     "autoUpdateAssetFetchPeriod": 120,
<     "autoUpdateDelayAfterLaunch": 180,
<     "autoUpdatePeriod": 7,
<     "blockingProfiles": "11111/#F00 11011/#C0F 11001/#00F 00001"
<   },
---
>   "hiddenSettings": {},
39,43c34
<     "chrome-scheme",
<     "moz-extension-scheme",
<     "opera-scheme",
<     "vivaldi-scheme",
<     "wyciwyg-scheme"
---
>     "moz-extension-scheme"

Expected behavior

Both backups should be identical except for timeStamp and version(?).

I don't know whether applying a version in the config can downgrade the extension. Let me know; I'm curious.

Troubleshooting information

Thanks for all the work on this extension. You have made the internet a better place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions