Closed
Bug 79473
Opened 23 years ago
Closed 23 years ago
setCharPref or setBoolPref does not work properly.
Categories
(Core Graveyard :: Embedding: APIs, defect)
Tracking
(Not tracked)
VERIFIED
WORKSFORME
People
(Reporter: dsirnapalli, Assigned: alecf)
Details
I used the following piece of code. var nsIPrefBranchObj = nsIPrefServiceObj.getDefaultBranch(null); alert(nsIPrefBranchObj.getCharPref("browser.startup.homepage")); nsIPrefBranchObj.setCharPref("browser.startup.homepage", "http://www.goto.com"); nsIPrefServiceObj.savePrefFile(null); alert(nsIPrefBranchObj.getCharPref("browser.startup.homepage")); The second alert shows the right value.It shows "http://www.goto.com", but when i open prefs.js, it still contains the old value.That means it's picking up the value from memory.When i close mozilla browser pref.js still contains the old value. When i run the above code again the first alert picks up the homepage from all.js("chrome://navigator-region/locale/region.properties") even though pref.js contains "www.mozilla.org".
Comment 1•23 years ago
|
||
I think if you do var nsIPrefBranchObj = nsIPrefServiceObj.getBranch(null); This code will do what you expect it to...
Assignee | ||
Comment 2•23 years ago
|
||
yes, they work, or the browser wouldn't save preferences!
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
Reporter | ||
Comment 3•23 years ago
|
||
when i use.. var nsIPrefBranchObj = nsIPrefServiceObj.getBranch(null); it works.
Status: RESOLVED → VERIFIED
Updated•5 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•