diff --git a/dom/network/Connection.cpp b/dom/network/Connection.cpp index dd384247f162..9edd59bda2c9 100644 --- a/dom/network/Connection.cpp +++ b/dom/network/Connection.cpp @@ -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); } } diff --git a/dom/network/Connection.h b/dom/network/Connection.h index 774616be91a4..06a5c005444a 100644 --- a/dom/network/Connection.h +++ b/dom/network/Connection.h @@ -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 aGivenProto) override; - ConnectionType Type() const { return mType; } + ConnectionType Type() const + { + return nsContentUtils::ShouldResistFingerprinting() ? + static_cast(ConnectionType::Unknown) : mType; + } IMPL_EVENT_HANDLER(typechange)