[tbb-commits] [tor-browser/tor-browser-52.1.0esr-7.0-2] Bug 21792: Suppress MediaError.message when privacy.resistFingerprinting = true

gk at torproject.org gk at torproject.org
Wed May 3 19:30:43 UTC 2017


commit 58d186df19450f9aef0423c71e78f6eaa17679f8
Author: Arthur Edelstein <arthuredelstein at gmail.com>
Date:   Thu Apr 27 15:00:14 2017 -0700

    Bug 21792: Suppress MediaError.message when privacy.resistFingerprinting = true
---
 dom/html/MediaError.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dom/html/MediaError.cpp b/dom/html/MediaError.cpp
index 83b9ffc..fae0981 100644
--- a/dom/html/MediaError.cpp
+++ b/dom/html/MediaError.cpp
@@ -7,6 +7,7 @@
 #include "mozilla/dom/MediaError.h"
 #include "nsDOMClassInfoID.h"
 #include "mozilla/dom/MediaErrorBinding.h"
+#include "nsContentUtils.h"
 
 namespace mozilla {
 namespace dom {
@@ -31,7 +32,12 @@ MediaError::MediaError(HTMLMediaElement* aParent, uint16_t aCode,
 void
 MediaError::GetMessage(nsAString& aResult) const
 {
-  CopyUTF8toUTF16(mMessage, aResult);
+  if (nsContentUtils::IsCallerChrome() ||
+      !nsContentUtils::ShouldResistFingerprinting()) {
+    CopyUTF8toUTF16(mMessage, aResult);
+  } else {
+    aResult.Truncate();
+  }
 }
 
 JSObject*



More information about the tbb-commits mailing list