mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
UAO: correct UA string rebuild code, add platform_version pref.
This commit is contained in:
parent
f8c34e7c0a
commit
f596e3d581
2 changed files with 30 additions and 3 deletions
|
|
@ -948,9 +948,35 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
|
|||
rv = prefs->GetBoolPref(UA_PREF("change_platform_version"), &cVar);
|
||||
mCompatPlatformEnabled = (NS_SUCCEEDED(rv) && cVar);
|
||||
|
||||
// Rebuild application version string.
|
||||
BuildAppVersion();
|
||||
|
||||
// Rebuild rv: and Goanna slice version
|
||||
mMisc.AssignLiteral("rv:");
|
||||
if (mCompatGeckoEnabled) {
|
||||
mMisc += mCompatFirefoxVersion;
|
||||
} else {
|
||||
if (mCompatPlatformEnabled) {
|
||||
mMisc += mCompatPlatformVersion;
|
||||
} else {
|
||||
mMisc += MOZILLA_UAVERSION;
|
||||
}
|
||||
}
|
||||
|
||||
if (mCompatGeckoEnabled) {
|
||||
if (mCompatPlatformEnabled) {
|
||||
mProductSub.Assign(mCompatPlatformVersion);
|
||||
} else {
|
||||
mProductSub.AssignLiteral(MOZILLA_UAVERSION);
|
||||
}
|
||||
} else {
|
||||
if (mCompatPlatformEnabled) {
|
||||
mProductSub.Assign(mCompatPlatformVersion);
|
||||
} else {
|
||||
mProductSub.Assign(mAppBuildID);
|
||||
}
|
||||
}
|
||||
// In case MOZILLA_UAVERSION is empty for some odd reason...
|
||||
if (mProductSub.IsEmpty()) {
|
||||
mProductSub.Assign(mAppBuildID);
|
||||
}
|
||||
mUserAgentIsDirty = true;
|
||||
}
|
||||
// general.useragent.platform_version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue