зеркало из https://github.com/mozilla/gecko-dev.git
Bug 583181 - Part 2: Add separate definitions for LEGACY_BUILD_ID and LEGACY_UA_GECKO_TRAIL. r=hsivonen
"Gecko trail" is the term used by MDN [1] for the YYYMMDD build date in the UA string's "Gecko/" token. Build ID is a YYYYMMDDHHMMSS build timestamp. Use LEGACY_BUILD_ID to spoof navigator.buildID. Use LEGACY_UA_GECKO_TRAIL to construct the UA string. [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox Differential Revision: https://phabricator.services.mozilla.com/D7983 --HG-- extra : rebase_source : e2a4d7579d419046f0bad6290078f9a652a770d8 extra : source : 8a26c8598528722a8920513c7fdfea40aefe0dbc
This commit is contained in:
Родитель
908795a253
Коммит
e70234b350
|
@ -456,8 +456,8 @@ Navigator::GetProduct(nsAString& aProduct)
|
|||
void
|
||||
Navigator::GetProductSub(nsAString& aProductSub)
|
||||
{
|
||||
// Legacy build ID hardcoded for backward compatibility (bug 776376)
|
||||
aProductSub.AssignLiteral(LEGACY_BUILD_ID);
|
||||
// Legacy build date hardcoded for backward compatibility (bug 776376)
|
||||
aProductSub.AssignLiteral(LEGACY_UA_GECKO_TRAIL);
|
||||
}
|
||||
|
||||
nsMimeTypeArray*
|
||||
|
|
|
@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=583181
|
|||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const LEGACY_BUILD_ID = 20100101; // Resist Fingerprinting's build ID
|
||||
const LEGACY_BUILD_ID = 20181001000000;
|
||||
|
||||
//
|
||||
// Access navigator.buildID from unprivileged web content.
|
||||
|
|
|
@ -516,7 +516,7 @@ nsHttpHandler::Init()
|
|||
#if defined(ANDROID)
|
||||
mProductSub.AssignLiteral(MOZILLA_UAVERSION);
|
||||
#else
|
||||
mProductSub.AssignLiteral(LEGACY_BUILD_ID);
|
||||
mProductSub.AssignLiteral(LEGACY_UA_GECKO_TRAIL);
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
|
|
|
@ -707,7 +707,7 @@ nsRFPService::GetSpoofedUserAgent(nsACString &userAgent)
|
|||
uint32_t spoofedVersion = firefoxVersion - ((firefoxVersion - 4) % 7);
|
||||
userAgent.Assign(nsPrintfCString(
|
||||
"Mozilla/5.0 (%s; rv:%d.0) Gecko/%s Firefox/%d.0",
|
||||
SPOOFED_UA_OS, spoofedVersion, LEGACY_BUILD_ID, spoofedVersion));
|
||||
SPOOFED_UA_OS, spoofedVersion, LEGACY_UA_GECKO_TRAIL, spoofedVersion));
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
#endif
|
||||
|
||||
#define SPOOFED_APPNAME "Netscape"
|
||||
#define LEGACY_BUILD_ID "20100101"
|
||||
#define LEGACY_BUILD_ID "20181001000000"
|
||||
#define LEGACY_UA_GECKO_TRAIL "20100101"
|
||||
|
||||
// Forward declare LRUCache, defined in nsRFPService.cpp
|
||||
class LRUCache;
|
||||
|
|
Загрузка…
Ссылка в новой задаче