-
Notifications
You must be signed in to change notification settings - Fork 102
Description
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")
}
}
}
}
}
EOFThe 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.htmlSteps to Reproduce
- Back up the extension.
- Generate the
policies.jsonwith the bash code provided in the "spoiler" (it works, the values are correctly applied; you can set your own values). - Create a new Firefox profile and open it.
- Let the extension fully install.
- Back up the extension.
diffthe 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.