mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Bug 1372072 - Part 1: Spoofing network information API and blocking ontypechange event when 'privacy.resistFingerprinting' is true. r=arthuredelstein,baku
This patch makes the network information API always returns the default type 'unknown' and blocking the ontypechange event while connection type changed when 'privacy. resistFingerprinting' is true. MozReview-Commit-ID: 4eOdHgAGtyY --HG-- extra : rebase_source : 78449fb4888b787062ff2139e36c219e0eac0b2c
This commit is contained in:
parent
73924a682a
commit
db3305baa3
@ -100,7 +100,8 @@ Connection::Update(ConnectionType aType, bool aIsWifi, bool aDHCPGateway,
|
||||
mIsWifi = aIsWifi;
|
||||
mDHCPGateway = aDHCPGateway;
|
||||
|
||||
if (aNotify && previousType != aType) {
|
||||
if (aNotify && previousType != aType &&
|
||||
!nsContentUtils::ShouldResistFingerprinting()) {
|
||||
DispatchTrustedEvent(CHANGE_EVENT_NAME);
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "mozilla/DOMEventTargetHelper.h"
|
||||
#include "mozilla/dom/NetworkInformationBinding.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsINetworkProperties.h"
|
||||
|
||||
@ -52,7 +53,11 @@ public:
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
ConnectionType Type() const { return mType; }
|
||||
ConnectionType Type() const
|
||||
{
|
||||
return nsContentUtils::ShouldResistFingerprinting() ?
|
||||
static_cast<ConnectionType>(ConnectionType::Unknown) : mType;
|
||||
}
|
||||
|
||||
IMPL_EVENT_HANDLER(typechange)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user