Closed Bug 77975 Opened 23 years ago Closed 23 years ago

regression: user.js no longer overrides prefs.js

Categories

(Core :: Preferences: Backend, defect, P2)

x86
Linux
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: akkzilla, Assigned: bnesse)

References

Details

(Keywords: regression, Whiteboard: [r][sr][a] trunk only)

Attachments

(2 files)

If I change a pref in my user.js, the change is ignored.  The old value is still
stored in prefs.js, and user.js, which is supposed to override prefs.js, no
longer does as of a recent change to prefs.
Keywords: regression
I take it that this is a file you've added? I don't seem to have one.
Status: NEW → ASSIGNED
User.js is a place where users can store their own prefs, safe from overwriting
by mozilla.  It lives in the profile directory next to prefs.js.
brian: a user would create the user.js by hand and place it in the same
directory as the prefs.js.
Should useUserPrefFile() in nsPrefService.cpp use
  openPrefFile(aFile, PR_FALSE, PR_FALSE, PR_FALSE, PR_TRUE)
instead of
  openPrefFile(mCurrentFile, PR_FALSE, PR_FALSE, PR_FALSE, PR_TRUE)
?
Yes, that would probably make a big difference.
cc'ing srilatha for an r and alecf for an sr on the patch.
r=srilatha
sr=alecf
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
reopening, since user.js still appears to be ignored. tested using 2001.05.29.08
comm bits on linux.

to test this, i created a user.js that simply overrode the default homepage. its
contents are simply:

  user_pref("browser.startup.homepage", "http://www.snopes.com/");

the default homepage that's in my prefs.js is http://bugzilla.mozilla.org/
--however, when i restart the browser, the default page is still the Bugzilla
page, not the one at Snopes.com.

i think whatever's in the user.js is currently being ignored --i tried another
test where i have a pref that's not explicitly mentioned in my prefs.js: in
user.js i put:

  user_pref("ui.key.menuAccessKeyFocuses", true);

[this allows hitting the menu access key, Alt in my case, to focus on the
menubar; by default this is off (false).]

after i restart the browser, however, this pref isn't activated --as if
menuAccessKeyFocuses is still false.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Hmm, this is actually a different bug, but I'm willing to fix it here :)

The problem is that openPrefFile is being called with the "skipFirstLine" flag
set to TRUE. I'm surprised that this hasn't shown up before now. It's been in
the code since the first revision of user.js support was integrated into Mozilla
back in '99. I went back to 4.x and verified that the first line is NOT supposed
to be skipped for user.js.
In my opinion, this should go into 0.9.1. It seams to be a safe fix, and to many
this is an important feature. Do people agree with me?
Since all versions of N6 have never read in the first line of user.js, people
using this feature will not experience any loss of functionality even without
this fix.

Moving to 0.9.2, P2.
Keywords: nsbeta1
Priority: -- → P2
Target Milestone: --- → mozilla0.9.2
sr=alecf
the fix is VERY simple, and only affects the reading of user.js, if the user
even has it...I think this is incredibly safe for 0.9.1.
r=chipc
This ONLY changes the reading of user.js... and even then only allows the
reading of the first line.   I agree, a very safe (simple) fix.
Whiteboard: [r][sr][need drivers approval]
Blocks: 83989
a=dbaron for trunk checkin (on behalf of drivers)
Whiteboard: [r][sr][need drivers approval] → [r][sr][a]
Fix checked in.
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Whiteboard: [r][sr][a] → [r][sr][a] trunk only
excellent, works now.

tested using 2001.06.19.08 comm bits on linux. as in my 2001-05-29 17:09
comments, i just had a user.js which contained:

  user_pref("browser.startup.homepage", "http://www.snopes.com/");

upon restarting the app, the default home page went to the Snopes site.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: