-
-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For modifying Firefox use user.js instead of modifying prefs.js #232
Comments
Hi @silverhook , thank you for your feedback with nice explanation and sources. Let me know in future if you see any other improvement area, I'm looking forward for this kind of feedback. You're right. It sounds safer to do changes on Thinking about the implementation, I guess because
|
Hi @silverhook , thank you for your feedback with nice explanation and
sources. Let me know in future if you see any other improvement area, I'm
looking forward for this kind of feedback.
Happy to help. I’m not really a user, but a colleague suggested to check it
out, so when I saw this I created the issue. More of a drive-by contribution
:)
Thinking about the implementation, I guess because `user.js` optional we
should do some additional file management in scripts:
- Create `user.js` file in profile folder if not exists.
- On revert, if revert operation resulted in empty `user.js` file, delete
the file.
That sounds sane to me, yes.
|
Manage Firefox preferences through `user.js` instead of `prefs.js`. Because of Mozilla's recommendation against direct `prefs.js` edits to avoid potential profile corruption. Instead, the `user.js` file, if present, overrides the settings in `prefs.js` at application startup. Change AddFirefoxPrefs function to update `user.js` and manage creation/deletion of this file: 1. Handle file creation if `user.js` does not exist. 2. Deletes file if `user.js` becomes empty after reverting settings. Other changes: - Improve log messages - Minimal refactorings
Fixed by 0.12.3 |
If I understand the code for this correctly, I think this causes an unintended and confusing situation:
|
Hi @ltguillaume, Privacy.sexy does no longer touches prefs.js since 0.12.3. See the code here. So your flow is right but the step 6. The line does not get removed by privacy.sexy, it just removes the line from Or did you mean that removing lines |
Sorry, in step 6 I meant that it got removed from
Yes, that's exactly what I meant. |
I can reproduce this. It works if privacy.sexy sets the opposite value of the desired configuration. But it does not work if privacy.sexy deletes the configuration from users.json. And in most cases it should delete the configuration, not to toggle values because the goal is to match the default state and a) opposite values are not necessarily the default values b) default values change over time c) sometimes values are more than booleans. I will push out Firefox configuration to all operating systems (Windows+macOS) too, so its important to get this stable. The only solution looks to be to modify prefs.json only if privacy.sexy is deleting a value on revert. I created #282 for this issue only, I appreciate your opinion @atomGit, @TheAndr0id, and @silverhook on that issue if you're around. |
Problem description
When it comes to modifying Firefox settings, the script currently searches for different
prefs.js
and modifies it there.This is heavily discouraged:
https://udn.realityripple.com/docs/Mozilla/Preferences/A_brief_guide_to_Mozilla_preferences#Preferences_Saving
Proposed solution
Write the changes in
user.js
instead.Will likely make the script a bit shorter and easier too :)
The text was updated successfully, but these errors were encountered: