mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-12 00:50:40 +00:00
fix for bug 59975 - general.useragent.override ignored, r=darin@netscape.com,sr=mscott@netscape.com
This commit is contained in:
parent
be43d5e2a0
commit
7dc2d704b2
@ -774,6 +774,8 @@ nsHTTPHandler::Init()
|
||||
HTTPPrefsCallback, (void*)this);
|
||||
mPrefs->RegisterCallback(INTL_ACCEPT_LANGUAGES,
|
||||
HTTPPrefsCallback, (void*)this);
|
||||
mPrefs->RegisterCallback(UA_PREF_PREFIX "override",
|
||||
HTTPPrefsCallback, (void*)this);
|
||||
mPrefs->RegisterCallback(UA_PREF_PREFIX "locale",
|
||||
HTTPPrefsCallback, (void*)this);
|
||||
mPrefs->RegisterCallback(UA_PREF_PREFIX "misc",
|
||||
@ -844,6 +846,8 @@ nsHTTPHandler::~nsHTTPHandler()
|
||||
HTTPPrefsCallback, (void*)this);
|
||||
mPrefs->UnregisterCallback(INTL_ACCEPT_LANGUAGES,
|
||||
HTTPPrefsCallback, (void*)this);
|
||||
mPrefs->UnregisterCallback(UA_PREF_PREFIX "override",
|
||||
HTTPPrefsCallback, (void*)this);
|
||||
mPrefs->UnregisterCallback(UA_PREF_PREFIX "locale",
|
||||
HTTPPrefsCallback, (void*)this);
|
||||
mPrefs->UnregisterCallback(UA_PREF_PREFIX "misc",
|
||||
@ -1467,6 +1471,19 @@ nsHTTPHandler::PrefsChanged(const char* pref)
|
||||
#endif
|
||||
}
|
||||
|
||||
// general.useragent.override
|
||||
if ((bChangedAll) || !PL_strcmp(pref, UA_PREF_PREFIX "override")) {
|
||||
nsXPIDLCString uval;
|
||||
nsresult rv = NS_OK;
|
||||
rv = mPrefs->CopyCharPref(UA_PREF_PREFIX "override",
|
||||
getter_Copies(uval));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mAppUserAgentOverride.Assign(uval);
|
||||
// rebuild the user agent
|
||||
BuildUserAgent();
|
||||
}
|
||||
}
|
||||
|
||||
if ( (bChangedAll)|| !PL_strcmp(pref, UA_PREF_PREFIX "locale") ) {// general.useragent.locale
|
||||
// 55156: re-Gather locale.
|
||||
nsXPIDLString uval;
|
||||
|
Loading…
Reference in New Issue
Block a user