[BUG] Firefox configuration changes not reverted when disabled
Describe the bug
Disabling the theme should ideally return to Firefox to how it was before the theme was enabled.
It would be nice if one could download Add Water, try out the theme, then if eg. they change their mind, toggling Enable Theme should return their profile to how it was beforehand.
To Reproduce
- Fresh install the app
- Toggle Enable Theme on
- Launch Firefox test it out
- Toggle Enable Theme off
- Relaunch Firefox
- See eg. dark
browser.theme.dark-private-windowsin about:config is now different to before step 1
user.js, userChrome.css, userContent.css (etc?) should also be cleaned up.
Technical Details (please complete the following information):
- Distribution: Debian
- Add Water version: v1.2.5
- Browser: Firefox
- Browser Package: Flatpak
- Browser Version: v135
For any who want to iterate the changed settings in about:config and revert them these are some to check.
The complication in the user.js case is that users expect to be able to edit the file at will for hardening or whatever, and I don't track the state of the file. So I stick to only editing the gnomeTheme values to reduce the risk of data loss. I keep a backup of the original file but we open another can of worms to reconcile the custom prefs between the backup and the current version.
I'll think on it more though because it definitely isn't ideal. Sorry about that.
My suggestion would be to:
- Track the lines that are added to the configuration files as part of the work the theme does. Upon disabling if matching lines are found in those files remove them.
- Cache each non
gnomeThemesetting that you know the theme is impacting. Revert it to it's pre-theme state upon disabling the theme. You may catch out some people who have changed those settings by hand in the meantime, but they're perhaps the power users who are less likely to need to use your app anyway? There's no perfectly clean solution, but at least this way you end up with the toggle working in both directions (not just towards enabled).