diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-05 16:40:21 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 13:24:59 +0200 |
commit | 1b8788aecbfd130a71757c7a99fc432b88f94026 (patch) | |
tree | 0314eaa1801559b76c6ea072fd03c766f8cc00bf | |
parent | 747632bd64adc5f400abe7d5f0da02573560a264 (diff) | |
download | UXP-1b8788aecbfd130a71757c7a99fc432b88f94026.tar UXP-1b8788aecbfd130a71757c7a99fc432b88f94026.tar.gz UXP-1b8788aecbfd130a71757c7a99fc432b88f94026.tar.lz UXP-1b8788aecbfd130a71757c7a99fc432b88f94026.tar.xz UXP-1b8788aecbfd130a71757c7a99fc432b88f94026.zip |
Issue #1505 - Part 3: Make native mode actually native again.
-rw-r--r-- | netwerk/protocol/http/nsHttpHandler.cpp | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp index 36f50a57f..7a29e041b 100644 --- a/netwerk/protocol/http/nsHttpHandler.cpp +++ b/netwerk/protocol/http/nsHttpHandler.cpp @@ -174,6 +174,7 @@ nsHttpHandler::nsHttpHandler() , mLegacyAppName("Mozilla") , mLegacyAppVersion("5.0") , mProduct("Goanna") + , mCompatGeckoEnabled(false) , mAppBuildID("20200101") , mCompatFirefoxEnabled(false) , mCompatFirefoxVersion("68.9") @@ -292,8 +293,13 @@ nsHttpHandler::Init() nsHttpChannelAuthProvider::InitializePrefs(); // rv: should have the Firefox/Gecko compatversion for web compatibility + // when in either compatmodes mMisc.AssignLiteral("rv:"); - mMisc += mCompatFirefoxVersion; + if (mCompatGeckoEnabled) { + mMisc += mCompatFirefoxVersion; + } else { + mMisc += MOZILLA_UAVERSION; + } mCompatGecko.AssignLiteral("Gecko/20100101"); mCompatFirefox.AssignLiteral("Firefox/"); @@ -338,8 +344,12 @@ nsHttpHandler::Init() do_GetService("@mozilla.org/network/request-context-service;1"); // Goanna slice version - mProductSub.AssignLiteral(MOZILLA_UAVERSION); - + if (mCompatGeckoEnabled) { + mProductSub.AssignLiteral(MOZILLA_UAVERSION); + } else { + mProductSub.Assign(mAppBuildID); + } + // In case MOZILLA_UAVERSION is empty for some odd reason... if (mProductSub.IsEmpty()) { mProductSub.Assign(mAppBuildID); } @@ -934,6 +944,24 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) if (PREF_CHANGED(UA_PREF("compatMode.gecko"))) { rv = prefs->GetBoolPref(UA_PREF("compatMode.gecko"), &cVar); mCompatGeckoEnabled = (NS_SUCCEEDED(rv) && cVar); + + // Rebuild rv: and Goanna slice version + mMisc.AssignLiteral("rv:"); + if (mCompatGeckoEnabled) { + mMisc += mCompatFirefoxVersion; + } else { + mMisc += MOZILLA_UAVERSION; + } + + if (mCompatGeckoEnabled) { + mProductSub.AssignLiteral(MOZILLA_UAVERSION); + } else { + mProductSub.Assign(mAppBuildID); + } + // In case MOZILLA_UAVERSION is empty for some odd reason... + if (mProductSub.IsEmpty()) { + mProductSub.Assign(mAppBuildID); + } mUserAgentIsDirty = true; } @@ -952,7 +980,11 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref) // rebuild mMisc and compatMode slice mMisc.AssignLiteral("rv:"); - mMisc += mCompatFirefoxVersion; + if (mCompatGeckoEnabled) { + mMisc += mCompatFirefoxVersion; + } else { + mMisc += MOZILLA_UAVERSION; + } mCompatFirefox.AssignLiteral("Firefox/"); mCompatFirefox += mCompatFirefoxVersion; |