mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1363508 - Part 3: Spoofing navigator.maxTouchPoints into 0 if fingerprinting resistance is enabled r=arthuredelstein,masayuki,smaug
The maxTouchPoints is going to review the detail of users' hardware. So, we will spoof it into 0 if fingerprinting resistance is on. Depends on D6004 Differential Revision: https://phabricator.services.mozilla.com/D6005 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
a8de9d009f
commit
b88841d2fd
@ -880,8 +880,15 @@ Navigator::Vibrate(const nsTArray<uint32_t>& aPattern)
|
||||
//*****************************************************************************
|
||||
|
||||
uint32_t
|
||||
Navigator::MaxTouchPoints()
|
||||
Navigator::MaxTouchPoints(CallerType aCallerType)
|
||||
{
|
||||
// The maxTouchPoints is going to reveal the detail of users' hardware. So,
|
||||
// we will spoof it into 0 if fingerprinting resistance is on.
|
||||
if (aCallerType != CallerType::System &&
|
||||
nsContentUtils::ShouldResistFingerprinting()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWidget> widget = widget::WidgetUtils::DOMWindowToWidget(mWindow->GetOuterWindow());
|
||||
|
||||
NS_ENSURE_TRUE(widget, 0);
|
||||
|
@ -150,7 +150,7 @@ public:
|
||||
bool Vibrate(uint32_t aDuration);
|
||||
bool Vibrate(const nsTArray<uint32_t>& aDuration);
|
||||
void SetVibrationPermission(bool aPermitted, bool aPersistent);
|
||||
uint32_t MaxTouchPoints();
|
||||
uint32_t MaxTouchPoints(CallerType aCallerType);
|
||||
void GetAppCodeName(nsAString& aAppCodeName, ErrorResult& aRv);
|
||||
void GetOscpu(nsAString& aOscpu, CallerType aCallerType,
|
||||
ErrorResult& aRv) const;
|
||||
|
@ -147,7 +147,7 @@ partial interface Navigator {
|
||||
|
||||
// http://www.w3.org/TR/pointerevents/#extensions-to-the-navigator-interface
|
||||
partial interface Navigator {
|
||||
[Pref="dom.w3c_pointer_events.enabled"]
|
||||
[Pref="dom.w3c_pointer_events.enabled", NeedsCallerType]
|
||||
readonly attribute long maxTouchPoints;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user