зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1806690 - Remove "rv:109.0" UA workaround for IE11. r=necko-reviewers,geckoview-reviewers,valentin,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D190395
This commit is contained in:
Родитель
7f888afcab
Коммит
022596d83c
|
@ -117,11 +117,6 @@ const CONST_VENDORSUB = "";
|
|||
const CONST_LEGACY_BUILD_ID = "20181001000000";
|
||||
|
||||
const appVersion = parseInt(Services.appinfo.version);
|
||||
const rvVersion =
|
||||
parseInt(
|
||||
Services.prefs.getIntPref("network.http.useragent.forceRVOnly", 0),
|
||||
0
|
||||
) || appVersion;
|
||||
const spoofedVersion = AppConstants.platform == "android" ? "115" : appVersion;
|
||||
|
||||
const LEGACY_UA_GECKO_TRAIL = "20100101";
|
||||
|
@ -345,7 +340,7 @@ async function testWorkerNavigator() {
|
|||
add_task(async function setupDefaultUserAgent() {
|
||||
let defaultUserAgent = `Mozilla/5.0 (${
|
||||
DEFAULT_UA_OS[AppConstants.platform]
|
||||
}; rv:${rvVersion}.0) Gecko/${
|
||||
}; rv:${appVersion}.0) Gecko/${
|
||||
DEFAULT_UA_GECKO_TRAIL[AppConstants.platform]
|
||||
} Firefox/${appVersion}.0`;
|
||||
expectedResults = {
|
||||
|
@ -380,7 +375,7 @@ add_task(async function setupRFPExemptions() {
|
|||
|
||||
let defaultUserAgent = `Mozilla/5.0 (${
|
||||
DEFAULT_UA_OS[AppConstants.platform]
|
||||
}; rv:${rvVersion}.0) Gecko/${
|
||||
}; rv:${appVersion}.0) Gecko/${
|
||||
DEFAULT_UA_GECKO_TRAIL[AppConstants.platform]
|
||||
} Firefox/${appVersion}.0`;
|
||||
|
||||
|
@ -415,11 +410,11 @@ add_task(async function setupResistFingerprinting() {
|
|||
|
||||
let spoofedUserAgentNavigator = `Mozilla/5.0 (${
|
||||
SPOOFED_UA_NAVIGATOR_OS[AppConstants.platform]
|
||||
}; rv:${rvVersion}.0) Gecko/${spoofedGeckoTrail} Firefox/${appVersion}.0`;
|
||||
}; rv:${appVersion}.0) Gecko/${spoofedGeckoTrail} Firefox/${appVersion}.0`;
|
||||
|
||||
let spoofedUserAgentHeader = `Mozilla/5.0 (${
|
||||
SPOOFED_UA_HTTPHEADER_OS[AppConstants.platform]
|
||||
}; rv:${rvVersion}.0) Gecko/${spoofedGeckoTrail} Firefox/${appVersion}.0`;
|
||||
}; rv:${appVersion}.0) Gecko/${spoofedGeckoTrail} Firefox/${appVersion}.0`;
|
||||
|
||||
expectedResults = {
|
||||
testDesc: "spoofed",
|
||||
|
|
|
@ -131,11 +131,6 @@ const CONST_VENDOR = "";
|
|||
const CONST_VENDORSUB = "";
|
||||
|
||||
const appVersion = parseInt(Services.appinfo.version);
|
||||
const rvVersion =
|
||||
parseInt(
|
||||
Services.prefs.getIntPref("network.http.useragent.forceRVOnly", 0),
|
||||
0
|
||||
) || appVersion;
|
||||
const spoofedVersion = AppConstants.platform == "android" ? "115" : appVersion;
|
||||
|
||||
const LEGACY_UA_GECKO_TRAIL = "20100101";
|
||||
|
@ -294,19 +289,19 @@ add_setup(async () => {
|
|||
DEFAULT_OSCPU.win = DEFAULT_UA_OS.win = await WindowsOscpuPromise;
|
||||
defaultUserAgent = `Mozilla/5.0 (${
|
||||
DEFAULT_UA_OS[AppConstants.platform]
|
||||
}; rv:${rvVersion}.0) Gecko/${
|
||||
}; rv:${appVersion}.0) Gecko/${
|
||||
DEFAULT_UA_GECKO_TRAIL[AppConstants.platform]
|
||||
} Firefox/${appVersion}.0`;
|
||||
|
||||
spoofedUserAgentNavigator = `Mozilla/5.0 (${
|
||||
SPOOFED_UA_NAVIGATOR_OS[AppConstants.platform]
|
||||
}; rv:${rvVersion}.0) Gecko/${
|
||||
}; rv:${appVersion}.0) Gecko/${
|
||||
SPOOFED_UA_GECKO_TRAIL[AppConstants.platform]
|
||||
} Firefox/${appVersion}.0`;
|
||||
|
||||
spoofedUserAgentHeader = `Mozilla/5.0 (${
|
||||
SPOOFED_UA_HTTPHEADER_OS[AppConstants.platform]
|
||||
}; rv:${rvVersion}.0) Gecko/${
|
||||
}; rv:${appVersion}.0) Gecko/${
|
||||
SPOOFED_UA_GECKO_TRAIL[AppConstants.platform]
|
||||
} Firefox/${appVersion}.0`;
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ android {
|
|||
buildConfigField 'String', "OMNIJAR_NAME", "\"${mozconfig.substs.OMNIJAR_NAME}\"";
|
||||
|
||||
// Keep in sync with actual user agent in nsHttpHandler::BuildUserAgent
|
||||
buildConfigField 'String', "USER_AGENT_GECKOVIEW_MOBILE", "\"Mozilla/5.0 (Android \" + android.os.Build.VERSION.RELEASE + \"; Mobile; rv:109.0) Gecko/\" + ${mozconfig.defines.MOZILLA_UAVERSION} + \" Firefox/\" + ${mozconfig.defines.MOZILLA_UAVERSION}";
|
||||
buildConfigField 'String', "USER_AGENT_GECKOVIEW_TABLET", "\"Mozilla/5.0 (Android \" + android.os.Build.VERSION.RELEASE + \"; Tablet; rv:109.0) Gecko/\" + ${mozconfig.defines.MOZILLA_UAVERSION} + \" Firefox/\" + ${mozconfig.defines.MOZILLA_UAVERSION}";
|
||||
buildConfigField 'String', "USER_AGENT_GECKOVIEW_MOBILE", "\"Mozilla/5.0 (Android \" + android.os.Build.VERSION.RELEASE + \"; Mobile; rv:\" + ${mozconfig.defines.MOZILLA_UAVERSION} + \") Gecko/\" + ${mozconfig.defines.MOZILLA_UAVERSION} + \" Firefox/\" + ${mozconfig.defines.MOZILLA_UAVERSION}";
|
||||
buildConfigField 'String', "USER_AGENT_GECKOVIEW_TABLET", "\"Mozilla/5.0 (Android \" + android.os.Build.VERSION.RELEASE + \"; Tablet; rv:\" + ${mozconfig.defines.MOZILLA_UAVERSION} + \") Gecko/\" + ${mozconfig.defines.MOZILLA_UAVERSION} + \" Firefox/\" + ${mozconfig.defines.MOZILLA_UAVERSION}";
|
||||
|
||||
buildConfigField 'int', 'MIN_SDK_VERSION', mozconfig.substs.MOZ_ANDROID_MIN_SDK_VERSION;
|
||||
|
||||
|
|
|
@ -11423,15 +11423,6 @@
|
|||
value: true
|
||||
mirror: always
|
||||
|
||||
# Set this pref to an integer like 99 to override the User-Agent string's
|
||||
# 'rv' bit. The value 0 means use the default Firefox version. We introduced
|
||||
# this for Firefox 110 because it turned out websites used user agent parsing
|
||||
# for "rv:11" to detect IE11.
|
||||
- name: network.http.useragent.forceRVOnly
|
||||
type: uint32_t
|
||||
value: 109
|
||||
mirror: always
|
||||
|
||||
# Whether or not we use Windows for SSO to Microsoft sites.
|
||||
- name: network.http.windows-sso.enabled
|
||||
type: RelaxedAtomicBool
|
||||
|
|
|
@ -388,15 +388,7 @@ nsresult nsHttpHandler::Init() {
|
|||
mAppVersion.AssignLiteral(MOZ_APP_UA_VERSION);
|
||||
}
|
||||
|
||||
mMisc.AssignLiteral("rv:");
|
||||
bool isFirefox = mAppName.EqualsLiteral("Firefox");
|
||||
uint32_t forceVersion =
|
||||
mozilla::StaticPrefs::network_http_useragent_forceRVOnly();
|
||||
if (forceVersion && (isFirefox || mCompatFirefoxEnabled)) {
|
||||
mMisc.Append(nsPrintfCString("%u.0", forceVersion));
|
||||
} else {
|
||||
mMisc.AppendLiteral(MOZILLA_UAVERSION);
|
||||
}
|
||||
mMisc.AssignLiteral("rv:" MOZILLA_UAVERSION);
|
||||
|
||||
// Generate the spoofed User Agent for fingerprinting resistance.
|
||||
nsRFPService::GetSpoofedUserAgent(mSpoofedUserAgent, true);
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPrefs_javascript.h"
|
||||
#include "mozilla/StaticPrefs_network.h"
|
||||
#include "mozilla/StaticPrefs_privacy.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/TextEvents.h"
|
||||
|
@ -828,16 +827,7 @@ void nsRFPService::GetSpoofedUserAgent(nsACString& userAgent,
|
|||
userAgent.AppendLiteral(SPOOFED_UA_OS);
|
||||
}
|
||||
|
||||
userAgent.AppendLiteral("; rv:");
|
||||
|
||||
uint32_t forceRV = mozilla::StaticPrefs::network_http_useragent_forceRVOnly();
|
||||
if (forceRV) {
|
||||
userAgent.Append(nsPrintfCString("%u.0", forceRV));
|
||||
} else {
|
||||
userAgent.AppendLiteral(MOZILLA_UAVERSION);
|
||||
}
|
||||
|
||||
userAgent.AppendLiteral(") Gecko/");
|
||||
userAgent.AppendLiteral("; rv:" MOZILLA_UAVERSION ") Gecko/");
|
||||
|
||||
#if defined(ANDROID)
|
||||
userAgent.AppendLiteral(MOZILLA_UAVERSION);
|
||||
|
|
Загрузка…
Ссылка в новой задаче