Closed
Bug 264680
Opened 20 years ago
Closed 3 years ago
Locking homepage causes getting default home page to fail
Categories
(Core :: Preferences: Backend, defect)
Core
Preferences: Backend
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: iannbugzilla, Unassigned)
References
(Blocks 1 open bug)
Details
Using Build ID 2004101605 on WinXP SP2
If you set a lockPref for browser.startup.homepage it causes the following code
from pref-navigator.js
http://lxr.mozilla.org/seamonkey/source/xpfe/components/prefwindow/resources/content/pref-navigator.js#102
to fail:
function getDefaultPage()
{
var prefService = Components.classes[PREFSERVICE_CONTRACTID]
.getService(nsIPrefService);
var pref = prefService.getDefaultBranch(null);
return pref.getComplexValue("browser.startup.homepage",
nsIPrefLocalizedString).data;
}
and gives the following error message in the JS console:
Error: uncaught exception: [Exception... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nsIPrefBranch.getComplexValue]" nsresult:
"0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
chrome://communicator/content/pref/pref-navigator.js :: getDefaultPage :: line
108" data: no]
Comment 1•20 years ago
|
||
Don't ask me why, but you cannot lock a localized pref to an arbitrary string,
it needs to be a properties file references like the default pref is.
Comment 2•20 years ago
|
||
This is probably dupe of the bug #109932
Comment 3•16 years ago
|
||
(Filter "spam" on 'prefs-nobody-20080612'.)
Assignee: prefs → nobody
QA Contact: prefs
Updated•15 years ago
|
QA Contact: preferences → preferences-backend
Comment 4•13 years ago
|
||
I just verified that this still happens.
The simplest way to recreate is to set
pref("browser.startup.homepage", "http://www.yahoo.com");
in a new JS file in defaults\pref in Firefox.
You'll get the error:
Timestamp: 4/13/2012 10:29:34 AM
Error: homePref.value is null
Source File: chrome://browser/content/preferences/main.js
Line: 63
Comment 5•13 years ago
|
||
So the issue is in this code:
http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/preferences.xml#312
browser.startup.homepage is a wstring, but if you set it as a pref (which people do), this code fails.
I think we should put a try catch around the code and use Components.interfaces.nsISupportsString if it fails.
Thoughts?
Updated•3 years ago
|
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•