[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 58d186df19450f9aef0423c71e78f6eaa17679f8
Author: Arthur Edelstein <arthuredelstein@xxxxxxxxx>
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*

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits