diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-05 16:40:21 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-05 16:40:21 +0200 |
commit | d9f17c9f8b973c4fd4799f2370e620cadae82910 (patch) | |
tree | 3214ed63c604b3eab784eab52d7cce67a4d4698e /netwerk/protocol | |
parent | eadff6165c87d78258fdcee8779ae5442cc92ea0 (diff) | |
download | UXP-d9f17c9f8b973c4fd4799f2370e620cadae82910.tar UXP-d9f17c9f8b973c4fd4799f2370e620cadae82910.tar.gz UXP-d9f17c9f8b973c4fd4799f2370e620cadae82910.tar.lz UXP-d9f17c9f8b973c4fd4799f2370e620cadae82910.tar.xz UXP-d9f17c9f8b973c4fd4799f2370e620cadae82910.zip |
Issue #1505 - Part 3: Make native mode actually native again.
Diffstat (limited to 'netwerk/protocol')
-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; |