Closed Bug 171225 Opened 22 years ago Closed 20 years ago

prefs stored in user.js are written to prefs.js; cannot reset to default pref be removing pref from user.js.

Categories

(Core :: Preferences: Backend, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 50038

People

(Reporter: david, Assigned: bnesse)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2b) Gecko/20020927
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2b) Gecko/20020927

I added a few hidden prefs to user.js.
I ran Mozilla, and they worked fine.
I exited Mozilla.
I deleted the user.js prefs, to get back to Mozilla default values.
I started Mozilla, and the hidden prefs I had set earlier were still in effect.
The said hidden prefs had been copied to prefs.js when I closed Mozilla, so they
were re-read when I started Mozilla again.

Reproducible: Always

Steps to Reproduce:
1. Exit Mozilla
2. Add a few prefs to user.js which are not in prefs.js
3. Start Mozilla (witness the prefs working)
4. Exit Mozilla
5. Remove prefs from user.js
6. Start Mozilla

Actual Results:  
The prefs which were removed from user.js were added to prefs.js, so they were
still in effect after restarting Mozilla.

Expected Results:  
The prefs which were removed from user.js should go back to the Mozilla default.

I realize a solution to this may be tricky.

You _could_ not write to prefs.js those prefs which exist in user.js.

The problem with that approach arises if you modify one of those user.js prefs
with the UI.  If the prefs in user.js aren't written back to prefs.js, the
setting wouldn't stick (unless mozilla writes something to user.js, but that
shouldn't happen either).

I think that mozilla should do something like this when saving prefs:
if the pref to be saved (in prefs.js) is in user.js
   if the pref has changed from what is in user.js
      save it to prefs.js, comment it out in user.js, with a note there
   else
      don't write it to prefs.js
Dupe of bug 97397. Same problem as reading from netscape.cfg. Would need to
differentiate where prefs come from...

*** This bug has been marked as a duplicate of 97397 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
I do not think this bug is a duplicate of 97397.  (The last comment
there seems to agree that these are not duplicates.)  As this bug
(171225) is still present in build 2002100504 (for Linux), I think
it should be re-opened.  It is not resolved.  It is a real problem
when you are experimenting with user.js.  To get rid of failed
experiments, you need to edit prefs.js itself, which is a no-no.

I also think this may happen on all platforms.  It is marked as
Windows, but I am using Linux.

better dupe is Bug 50038
reopening to dupe correctly
Status: RESOLVED → UNCONFIRMED
Resolution: DUPLICATE → ---

*** This bug has been marked as a duplicate of 50038 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.